[24269] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6460 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 25 03:05:46 2004

Date: Sun, 25 Apr 2004 00:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 25 Apr 2004     Volume: 10 Number: 6460

Today's topics:
        Array index bug using concatenated numbers <krahnj@acm.org>
    Re: Array index bug using concatenated numbers <invalid-email@rochester.rr.com>
    Re: Array index bug using concatenated numbers <Joe.Smith@inwap.com>
    Re: does any other language even have this feature? <dha@panix.com>
    Re: ides <spamtrap@dot-app.org>
    Re: Novice and willing to learn <jtc@shell.dimensional.com>
    Re: Novice and willing to learn <andries@zilz.nl>
    Re: Novice and willing to learn <gnari@simnet.is>
    Re: Novice and willing to learn <jtc@shell.dimensional.com>
    Re: Novice and willing to learn <andries@zilz.nl>
    Re: Novice and willing to learn <jurgenex@hotmail.com>
    Re: Novice and willing to learn <robin @ infusedlight.net>
    Re: Novice and willing to learn <spamtrap@dot-app.org>
    Re: Please Recommend A Good Perl Book. <jtc@shell.dimensional.com>
    Re: Please Recommend A Good Perl Book. <noemail@#$&&!.net>
    Re: Please Recommend A Good Perl Book. <dave@dave.org.uk>
    Re: Proper way to use an imported constant under 'use s <robin @ infusedlight.net>
    Re: Proper way to use an imported constant under 'use s <sbryce@scottbryce.com>
    Re: Proper way to use an imported constant under 'use s <robin @ infusedlight.net>
    Re: Running Perl From Web Page W/out Changing Page? <robin @ infusedlight.net>
    Re: Running Perl From Web Page W/out Changing Page? <soon.the.sp@mmers.and.evil.ones.will.bow-down-to.us>
    Re: slurp not working? ideas please! <tassilo.parseval@rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 25 Apr 2004 03:36:35 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Array index bug using concatenated numbers
Message-Id: <408B3218.3EE362EE@acm.org>

I ran across this problem on the Perl beginners mailing list and am
posting here because I am not running the current version of Perl and
would like someone else to confirm this.

The following code should demonstrate the problem:

#!/usr/bin/perl
use warnings;
use strict;

use constant X => 99;
use constant Y => 99;
my @array;
my @check1;
my @check2;
my $diff = 0;

for my $x ( 0 .. X ) {
    for my $y ( 0 .. Y ) {
        my $i = 0 + ( $x . $y );
        $array[ $i ] = int( rand ~0 );
        push @check1, $array[ $i ];
        }
    }

for my $x ( 0 .. X ) {
    for my $y ( 0 .. Y ) {
        my $i = 0 + ( $x . $y );
        push @check2, $array[ $i ];
        if ( $check1[ $#check2 ] != $check2[ $#check2 ] ) {
            print "$x . $y    $check1[$#check2]    $check2[$#check2]\n";
            $diff++;
            }
        }
    }

print "\n$diff differences from ", X, Y, " entries\n";

__END__

This _should_ print out "0 differences from 9999 entries" but on my
computer I get 900 differences.  If I change "my $i = 0 + ( $x . $y );"
to "my $i = $x * 100 + $y;" it works correctly with 0 differences.  This
looks like a bug in array indexing.

The original thread is at
http://groups.google.com/groups?threadm=4087A478.18574.7F3DCA%40localhost


TIA
John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Sun, 25 Apr 2004 04:21:04 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Array index bug using concatenated numbers
Message-Id: <408B3CAD.6050108@rochester.rr.com>

John W. Krahn wrote:

> I ran across this problem on the Perl beginners mailing list and am
> posting here because I am not running the current version of Perl and
> would like someone else to confirm this.
> 
> The following code should demonstrate the problem:
> 
> #!/usr/bin/perl
> use warnings;
> use strict;
> 
> use constant X => 99;
> use constant Y => 99;
> my @array;
> my @check1;
> my @check2;
> my $diff = 0;
> 
> for my $x ( 0 .. X ) {
>     for my $y ( 0 .. Y ) {
>         my $i = 0 + ( $x . $y );
>         $array[ $i ] = int( rand ~0 );
>         push @check1, $array[ $i ];
>         }
>     }
> 
> for my $x ( 0 .. X ) {
>     for my $y ( 0 .. Y ) {
>         my $i = 0 + ( $x . $y );
>         push @check2, $array[ $i ];
>         if ( $check1[ $#check2 ] != $check2[ $#check2 ] ) {
>             print "$x . $y    $check1[$#check2]    $check2[$#check2]\n";
>             $diff++;
>             }
>         }
>     }
> 
> print "\n$diff differences from ", X, Y, " entries\n";
> 
> __END__
> 
> This _should_ print out "0 differences from 9999 entries" but on my
> computer I get 900 differences.  If I change "my $i = 0 + ( $x . $y );"
> to "my $i = $x * 100 + $y;" it works correctly with 0 differences.  This
> looks like a bug in array indexing.
> 
> The original thread is at
> http://groups.google.com/groups?threadm=4087A478.18574.7F3DCA%40localhost
> 
 ...


> John
> 

It appears like the "900 differences" result is correct.  Consider 
$array[1000], for example.  It contains undef.  That's because the 
number 1000 was never made by the expression 0+($x.$y) -- there is not 
combination of $x and $y in the range 0..99 which will make that 
expression generate 1000.  There are 10000 elements in @array, and 900 
of them contain undef.  That's because the subscript values for each of 
these 900 elements were never generated in $i.  This then implies that 
some other element of @array was assigned each time -- specifically, 900 
other elements got written twice (consider for example which element 
gets written when $x is 0 and $y is 11 versus when $x is 1 and $y is 1). 
  So when @check2 is generated from @array, 900 array elements from 
@array had different results in them than when the results were stored 
in @check1.  Thus 900 differences.

HTH.
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



------------------------------

Date: Sun, 25 Apr 2004 05:40:12 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Array index bug using concatenated numbers
Message-Id: <0bIic.26655$aQ6.1523736@attbi_s51>

John W. Krahn wrote:

> for my $x ( 0 .. X ) {
>     for my $y ( 0 .. Y ) {
>         my $i = 0 + ( $x . $y );

Let's see; if $x = 1 and $y = 23, then $i = "123".
But then   if $x = 12 and $y = 3, then $i = "123".
Therefore $array[$i] is going to get clobbered because you told it to.

As you noticed, changing the calculation of $i so that it does not
produce any duplicates makes the "problem" go away.

As does using proper indexing: $array[$x][$y] = "something";

I see no bug here.
	-Joe


------------------------------

Date: Sun, 25 Apr 2004 03:10:31 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: does any other language even have this feature?
Message-Id: <slrnc8mb17.avd.dha@panix2.panix.com>

In article <slrnc8ja4b.67o.tadmc@magna.augustmail.com>, Tad McClellan wrote:
> valued customer <scooterm@hotmail.com> wrote:
> 
> 
>> One of the very useful features of perl is the quotelike
>> operator, 
> 
> 
> It's more usual name is "here document".

First, the OP seems to  be talking about q{} and friends, rather than
here docs.

Second, here docs weren't even in perlop at all, much less under Quote
and Quote-like Operators until fairly recently, which makes it even less
likely that that's what was meant.

Finally, "It's"??  Oh, Tad, I know you know better than that... :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Linguists don't know much, but they do know that nobody can succeed in
telling people at large how to speak.	- Larry Wall


------------------------------

Date: Sat, 24 Apr 2004 18:41:56 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: ides
Message-Id: <s5udnT-nt8GrcBfdRVn-ig@adelphia.com>

Robin wrote:

> I'm thinking about perl ides

Beware the ides of Perl! (Sorry, couldn't resist...)

> in VB or Visual CPP and I'm wondering if 
> someone has some good links on how it's done or some information on how
> one could access the perl binary to produce output in a window on windows?

ActiveState makes a product called "Visual Perl" that integrates into
Microsoft's Visual Studio. I don't know if it will help do GUI stuff from
Perl though.

<http://www.activestate.com/Products/Visual_Perl/>

sherm--

PS: If you ever want to do something similar on a Mac, have a look at
CamelBones. ;-)

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: 24 Apr 2004 16:31:50 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Novice and willing to learn
Message-Id: <slrnc8lqml.fam.jtc@shell.dimensional.com>

In article <p4ll80dcqiupn7dv2e3tc8pf9p4l3f6vdd@4ax.com>, Andries wrote:
> First of all my apologies! Truly meant.
> No, i don't have code. How could I
> I just started and i'm not further yet than "Hello world"
> I use the sybex book called  Perl, CGI and Javascript Complete.
> 
> I didn't want to insult any of you.
> I always learn a lot from questions i ask and things i really need and
> can use. I'm not a very theoretical man. I have trouble reading
> learning books on computers. I really learn a lot from the problems i
> stumble on and the question for help. When i comprehend a bit of the
> language of Perl i'm on my way to make things myself because i can
> look it up. When starting from scratch (as i am) is difficult.
> I looked in this newsgroup an read a few things but most is mystical
> to me.
> I never made any program because when i was a youngster there weren't
> any computers. And now at the age of 50 i want to learn Perl because i
> read and heard it can do a lot with large quantaties of text.
> 
> I understand yout point and have to try first and make some code.
> Point taken.
> Anyway really thanks for pointing this out to me.
> I guess i was a bit naive.

The first step in solving a problem is to define, as precisely as
possible, what the problem is.  Sometimes this is the hardest part
of developing a program or application; and sometimes it requires an
iterative process - e.g., start with an initial problem specification,
experiment with implementations, realize that it would really be better
if you changed the spec. to be more general, comprehensive, specific,
or etc.

However, after some experience with this process you'll probably get
better at coming up with a good, well-thought-out initial problem
specification, essentially going through a good part of the process of
refining the specification in your mind (and/or on paper) before you
even write a line of code, usually saving much time in the process.

The better you get at producing a good, complete spec., the better
results you're likely to get if you post to this group needing help
with the implementation.  (Though I'd wager that if you word your
request well you're likely to even get good help in coming up with a
good specification, as well as help with the implementation.)

Good luck - 50 is definitely not too old to learn good development and
programming skills if you have the interest and commitment.

-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


------------------------------

Date: Sun, 25 Apr 2004 00:49:42 +0200
From: Andries <andries@zilz.nl>
Subject: Re: Novice and willing to learn
Message-Id: <j8rl80tbe2agkt40cojo2ovl22uejli226@4ax.com>

On 24 Apr 2004 16:31:50 -0600, Jim Cochrane
<jtc@shell.dimensional.com> wrote:


>
>The first step in solving a problem is to define, as precisely as
>possible, what the problem is.  Sometimes this is the hardest part
>of developing a program or application; and sometimes it requires an
>iterative process - e.g., start with an initial problem specification,
>experiment with implementations, realize that it would really be better
>if you changed the spec. to be more general, comprehensive, specific,
>or etc.
>
>However, after some experience with this process you'll probably get
>better at coming up with a good, well-thought-out initial problem
>specification, essentially going through a good part of the process of
>refining the specification in your mind (and/or on paper) before you
>even write a line of code, usually saving much time in the process.
>
>The better you get at producing a good, complete spec., the better
>results you're likely to get if you post to this group needing help
>with the implementation.  (Though I'd wager that if you word your
>request well you're likely to even get good help in coming up with a
>good specification, as well as help with the implementation.)
>
>Good luck - 50 is definitely not too old to learn good development and
>programming skills if you have the interest and commitment.

Let me try to explain my question.
I use a program (Whisper) to generate passwords.
I have to fill in the (real-name), the username, the pwd and a
memo-field with data of the "customer"
I have hundreds of these accounts.

I can export all this data to a csv - file

So I have a text-file. What i want is to sort some of the data f.i.
name an pwd out and put them in a new text-file
The example I used before is just an example and I made xxxxx to
disclose the identities.

Andries


------------------------------

Date: Sat, 24 Apr 2004 22:07:54 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Novice and willing to learn
Message-Id: <c6eod2$70a$1@news.simnet.is>

"Andries" <andries@zilz.nl> wrote in message
news:p4ll80dcqiupn7dv2e3tc8pf9p4l3f6vdd@4ax.com...
> I just started and i'm not further yet than "Hello world"
> I use the sybex book called  Perl, CGI and Javascript Complete.
>

You should familarize yourself with the docs
that come with perl.

actually the problem you selected is a good one for a beginner,
but you should at least show is what you have tried yourself
before asking for help. as an exercise, I suggest you start by
making a program that reads the input lines and prints then all
out. when that is solved, add things to it, like just printing
a line matching a specific condition. there are many ways to
test your lines, like using substr(), index() or regular expressions
look these up in the docs:
  perldoc -f substr
  perldoc -f index
  perldoc perlre

take a look at http://learn.perl.org/

good luck

gnari






------------------------------

Date: 24 Apr 2004 17:06:21 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Novice and willing to learn
Message-Id: <slrnc8lsnd.fam.jtc@shell.dimensional.com>

In article <j8rl80tbe2agkt40cojo2ovl22uejli226@4ax.com>, Andries wrote:
> On 24 Apr 2004 16:31:50 -0600, Jim Cochrane
><jtc@shell.dimensional.com> wrote:
>>The first step in solving a problem is to define, as precisely as
>>possible, what the problem is.  Sometimes this is the hardest part
>>of developing a program or application; and sometimes it requires an
>>iterative process - e.g., start with an initial problem specification,
>>experiment with implementations, realize that it would really be better
>>if you changed the spec. to be more general, comprehensive, specific,
>>or etc.
>>
>>However, after some experience with this process you'll probably get
>>better at coming up with a good, well-thought-out initial problem
>>specification, essentially going through a good part of the process of
>>refining the specification in your mind (and/or on paper) before you
>>even write a line of code, usually saving much time in the process.
>>
>>The better you get at producing a good, complete spec., the better
>>results you're likely to get if you post to this group needing help
>>with the implementation.  (Though I'd wager that if you word your
>>request well you're likely to even get good help in coming up with a
>>good specification, as well as help with the implementation.)
>>
>>Good luck - 50 is definitely not too old to learn good development and
>>programming skills if you have the interest and commitment.
> 
> Let me try to explain my question.
> I use a program (Whisper) to generate passwords.
> I have to fill in the (real-name), the username, the pwd and a
> memo-field with data of the "customer"
> I have hundreds of these accounts.
> 
> I can export all this data to a csv - file
> 
> So I have a text-file. What i want is to sort some of the data f.i.
> name an pwd out and put them in a new text-file
> The example I used before is just an example and I made xxxxx to
> disclose the identities.

This is a good start.  If I understand right, it sounds like you need at
least two requirements wrt processing the text file*:

  - Select a subset of the records in the file according to some criteria
    ("sort some of the data").
  - For each record, print out just the name and password field.
    (This is easy if the data is, as you imply, structured.)

[I guess sorting is another requirement, but it can be dealt with later.]

The question then arises: What criteria do you want to use to select a
subset of the records?  A general description of the different criteria
and/or some examples would be very helpful.

* This may be my ignorance of a standard convention, but I don't know what
"f.i." stands for.  If it has a bearing on the requirements, let me know.
-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


------------------------------

Date: Sun, 25 Apr 2004 01:42:12 +0200
From: Andries <andries@zilz.nl>
Subject: Re: Novice and willing to learn
Message-Id: <agtl80p22qbpj9edc7d5ndhabei9pc06ld@4ax.com>

On 24 Apr 2004 17:06:21 -0600, Jim Cochrane
<jtc@shell.dimensional.com> wrote:

>In article <j8rl80tbe2agkt40cojo2ovl22uejli226@4ax.com>, Andries wrote:
>> On 24 Apr 2004 16:31:50 -0600, Jim Cochrane
>><jtc@shell.dimensional.com> wrote:
>>>The first step in solving a problem is to define, as precisely as
>>>possible, what the problem is.  Sometimes this is the hardest part
>>>of developing a program or application; and sometimes it requires an
>>>iterative process - e.g., start with an initial problem specification,
>>>experiment with implementations, realize that it would really be better
>>>if you changed the spec. to be more general, comprehensive, specific,
>>>or etc.
>>>
>>>However, after some experience with this process you'll probably get
>>>better at coming up with a good, well-thought-out initial problem
>>>specification, essentially going through a good part of the process of
>>>refining the specification in your mind (and/or on paper) before you
>>>even write a line of code, usually saving much time in the process.
>>>
>>>The better you get at producing a good, complete spec., the better
>>>results you're likely to get if you post to this group needing help
>>>with the implementation.  (Though I'd wager that if you word your
>>>request well you're likely to even get good help in coming up with a
>>>good specification, as well as help with the implementation.)
>>>
>>>Good luck - 50 is definitely not too old to learn good development and
>>>programming skills if you have the interest and commitment.
>> 
>> Let me try to explain my question.
>> I use a program (Whisper) to generate passwords.
>> I have to fill in the (real-name), the username, the pwd and a
>> memo-field with data of the "customer"
>> I have hundreds of these accounts.
>> 
>> I can export all this data to a csv - file
>> 
>> So I have a text-file. What i want is to sort some of the data f.i.
>> name an pwd out and put them in a new text-file
>> The example I used before is just an example and I made xxxxx to
>> disclose the identities.
>
>This is a good start.  If I understand right, it sounds like you need at
>least two requirements wrt processing the text file*:
>
>  - Select a subset of the records in the file according to some criteria
>    ("sort some of the data").
>  - For each record, print out just the name and password field.
>    (This is easy if the data is, as you imply, structured.)
>
>[I guess sorting is another requirement, but it can be dealt with later.]
>
>The question then arises: What criteria do you want to use to select a
>subset of the records?  A general description of the different criteria
>and/or some examples would be very helpful.
>
>* This may be my ignorance of a standard convention, but I don't know what
>"f.i." stands for.  If it has a bearing on the requirements, let me know.

I have the next (few hundreds of)
sex: male
Surname :    Great
Voorletters: A
Tussenvoegsel(s): the
Adres :  xxxxx
Postcode :  xxxxx
Woonplaats :  xxxx
Telefoonnummer : xxxxx
e-mail (privé) : xxxxxx
Schoollocatie : Humbold
Schooladres : xxxxxx
Postcode: xxxxx
Plaats : xxxxx
Telefoonnummer: xxxxx
E-mail school : xxxxxxx

It's all in a long, long text-file all different names, adresses etc.

I want to pick a few items of the data out like the name and the
school and put them in a new textfile like a list with:
name: Great
School: Humbold
[new line]
name: Johnson
School: Harvard
[new line]
etc

I think it should be like this (in laymans terms)
->Read the oldfile
->Look for name: 
->Remember name: and whats behind the:
->Look for school: and what's behind the :
->Make a new (empy) line 
->Look for name: 
->Remember name: and whats behind the:
->Look for school: and what's behind the :
->Make a new (empy) line 
and so on
-> write to newfile 


perl myprog.pl < oldfile newfile >

Andries



------------------------------

Date: Sun, 25 Apr 2004 02:51:56 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Novice and willing to learn
Message-Id: <gJFic.67735$L31.60771@nwrddc01.gnilink.net>

Robin wrote:
>> And now at the age of 50 i want to learn Perl because i
>> read and heard it can do a lot with large quantaties of text.
>
> Yeah, just from the name you can infer it - Perl = Practical
> Extraction and Report Language.

Please don't contribute to the proliferation of urban legends.
See "perldoc perl": "What's the difference between "perl" and "Perl"?"
last sentence.

jue




------------------------------

Date: Sat, 24 Apr 2004 20:15:46 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: Novice and willing to learn
Message-Id: <c6fbu9$uq9$1@reader2.nmix.net>


"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:gJFic.67735$L31.60771@nwrddc01.gnilink.net...
> Robin wrote:
> >> And now at the age of 50 i want to learn Perl because i
> >> read and heard it can do a lot with large quantaties of text.
> >
> > Yeah, just from the name you can infer it - Perl = Practical
> > Extraction and Report Language.
>
> Please don't contribute to the proliferation of urban legends.
> See "perldoc perl": "What's the difference between "perl" and "Perl"?"
> last sentence.

point taken, I suppose.
-Robin




------------------------------

Date: Sat, 24 Apr 2004 23:53:05 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Novice and willing to learn
Message-Id: <QtWdnYEjqPq_qxbdRVn-sQ@adelphia.com>

Jürgen Exner wrote:

> See "perldoc perl": "What's the difference between "perl" and "Perl"?"
> last sentence.

I think you mean "perldoc perlfaq1".

According to the (nearly) last sentence in "perldoc perl", it stands for
"Pathologically Eclectic Rubbish Lister". For some reason I doubt that's
what you were referring to... ;-)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: 24 Apr 2004 16:39:41 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <slrnc8lr5d.fam.jtc@shell.dimensional.com>

In article <icol805ssvfpgaqi55grpnh3qt455e4kk6@4ax.com>, Matija Papec wrote:
> X-Ftn-To: Fred 
> 
> Fred <noemail@#$&&!.net> wrote:
>>Rating a book is very subjective, I know. I am an expereinced programmer
>>but have never used perl. (Got sort of hooked on a2p however... :))
>>
>>At any rate, I need a good perl book to cover middle to advanced topics.
>>It would have prehaps only 2 pages on control structures. Cover all the
>>operators on another page, etc.. Then cover real life topics, date
>>processing, using modules, etc.
> 
> "Effective Perl" is imo excellent book and "Perl Cookbook" is what you want
> when you become familiar with some basics. There are also other books but
> these two cover in detail pretty much everything.
> 

An anti-rec.: IMO, don't buy "Core Perl."  It's mediorcre - lousy index,
incomplete as a reference, etc.  I'd give more comprehensive criticism if I
had more time, but unfortunately, I don't.

OTO, I've found Effective Perl to be generally quite good, but it's not a
reference, so you'd probably want to augment it with another good book that
covers Perl in a more complete way.  [OO Perl is also good if you want to
also focus on OO development, but that may not be one of your goals.]

Don't forget to check out the reviews on amazon for books you put on
your list.  If you read the reviews with a sharp, critical, yet open,
mind, they can often be quite helpful.

-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


------------------------------

Date: Sat, 24 Apr 2004 18:04:14 +0000
From: Fred <noemail@#$&&!.net>
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <pan.2004.04.24.18.04.13.808754@#$&&!.net>

On Sat, 24 Apr 2004 16:39:41 -0600, Jim Cochrane wrote:

> In article <icol805ssvfpgaqi55grpnh3qt455e4kk6@4ax.com>, Matija Papec wrote:
>> X-Ftn-To: Fred 
>> 
>> Fred <noemail@#$&&!.net> wrote:
>>>Rating a book is very subjective, I know. I am an expereinced programmer
>>>but have never used perl. (Got sort of hooked on a2p however... :))
>>>
>>>At any rate, I need a good perl book to cover middle to advanced topics.
>>>It would have prehaps only 2 pages on control structures. Cover all the
>>>operators on another page, etc.. Then cover real life topics, date
>>>processing, using modules, etc.
>> 
>> "Effective Perl" is imo excellent book and "Perl Cookbook" is what you want
>> when you become familiar with some basics. There are also other books but
>> these two cover in detail pretty much everything.
>> 
> 
> An anti-rec.: IMO, don't buy "Core Perl."  It's mediorcre - lousy index,
> incomplete as a reference, etc.  I'd give more comprehensive criticism if I
> had more time, but unfortunately, I don't.
> 
> OTO, I've found Effective Perl to be generally quite good, but it's not a
> reference, so you'd probably want to augment it with another good book that
> covers Perl in a more complete way.  [OO Perl is also good if you want to
> also focus on OO development, but that may not be one of your goals.]
> 
> Don't forget to check out the reviews on amazon for books you put on
> your list.  If you read the reviews with a sharp, critical, yet open,
> mind, they can often be quite helpful.


Thank you fellows, yes I hit amazon, and was amazed at how many books
there were which prompted my post initially. Thanks for your input, I will
read the reviews on the books you all mentioned, and from my initial
investigations it looks like 'Learing Perl, Third Edition' by Randal L.
Schwartz (Author), Tom Phoenix (Author) is good for an overview with
'Programming Perl' (Third Edition) by Larry Wall, et al  - being good to
back it up as a reference. O'REILLY strikes again with the Llama and a
Camel! 

Cheers!


------------------------------

Date: Sun, 25 Apr 2004 07:55:01 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <pan.2004.04.25.06.55.01.906810@dave.org.uk>

On Sat, 24 Apr 2004 16:15:25 +0000, Fred wrote:

> Rating a book is very subjective, I know. I am an expereinced programmer
> but have never used perl. (Got sort of hooked on a2p however... :))
> 
> At any rate, I need a good perl book to cover middle to advanced topics.
> It would have prehaps only 2 pages on control structures. Cover all the
> operators on another page, etc.. Then cover real life topics, date
> processing, using modules, etc.

The Perl community's recommendations for books are listed in the FAQ
(perlfaq2) and are online at
http://perldoc.com/perl5.8.0/pod/perlfaq2.html#Perl-Books.

You might also like to check out the Perl books site at
http://books.perl.org/.

Dave...




------------------------------

Date: Sat, 24 Apr 2004 17:42:48 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: Proper way to use an imported constant under 'use strict'?
Message-Id: <c6f2oj$s5k$2@reader2.nmix.net>

>[minter@localhost mrvoice]$ ./mrvoice.pl
>Bareword "NORMAL_PRIORITY_CLASS" not allowed while "strict subs" in >use
>at ./mrvoice.pl line 3513.
>Execution of ./mrvoice.pl aborted due to compilation errors.

>My question is - what's the proper way to use this constant when strictures
>are enabled?


I went through this exact same thing myself. All you have to do is define
all your variables with my or local and then call your subs like this(); or
this ("something") instead of like this;
-Robin





------------------------------

Date: Sat, 24 Apr 2004 18:51:10 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Proper way to use an imported constant under 'use strict'?
Message-Id: <108m2s24i35731@corp.supernews.com>

Robin wrote:

> I went through this exact same thing myself. All you have to do is define
> all your variables with my or local and then call your subs like this(); or
> this ("something") instead of like this;

Are you aware that your answer has nothing whatsoever to do with the OPs 
question?

I've been writing Perl scripts for over a year, and I wouldn't pretend 
to know the answer to the OPs question.



------------------------------

Date: Sat, 24 Apr 2004 17:58:19 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: Proper way to use an imported constant under 'use strict'?
Message-Id: <c6f3lm$sff$1@reader2.nmix.net>


"Scott Bryce" <sbryce@scottbryce.com> wrote in message
news:108m2s24i35731@corp.supernews.com...
> Robin wrote:
>
> > I went through this exact same thing myself. All you have to do is
define
> > all your variables with my or local and then call your subs like this();
or
> > this ("something") instead of like this;
>
> Are you aware that your answer has nothing whatsoever to do with the OPs
> question?
>
> I've been writing Perl scripts for over a year, and I wouldn't pretend
> to know the answer to the OPs question.

now I am...sorry H Wade to confuse.

--
Regards,
-Robin
--
[ webmaster @ infusedlight.net ]
www.infusedlight.net




------------------------------

Date: Sat, 24 Apr 2004 17:39:24 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: Running Perl From Web Page W/out Changing Page?
Message-Id: <c6f2oi$s5k$1@reader2.nmix.net>


"Hal Vaughan" <hal@thresholddigital.com> wrote in message
news:VK9ic.11097$IW1.736155@attbi_s52...
> Is there any way to run a Perl script from a web page without changing the
> web page?
>
> I'd like to be able to click a button on a web page and have it run a
script
> in the background, but not have to re-load the page or change anything. Is
> this possible?
>
> Thanks!
>

do a google search for ssi tutorial, that's where I started with this.
-Robin




------------------------------

Date: Sun, 25 Apr 2004 02:46:20 -0400
From: FLEB <soon.the.sp@mmers.and.evil.ones.will.bow-down-to.us>
Subject: Re: Running Perl From Web Page W/out Changing Page?
Message-Id: <1owp8sjcsenwz.c2egldtqe02c$.dlg@40tude.net>

Regarding this well-known quote, often attributed to Hal Vaughan's famous
"Fri, 23 Apr 2004 14:29:10 GMT" speech:

> Is there any way to run a Perl script from a web page without changing the
> web page?
> 
> I'd like to be able to click a button on a web page and have it run a script
> in the background, but not have to re-load the page or change anything.  Is
> this possible?
> 
> Thanks!
> 
> Hal

You could posibly do something with frames, iframes, or popups exchanging
information via JavaScript, but you'd have to watch for browser
compatibility issues.

-- 
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
   (put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com


------------------------------

Date: 25 Apr 2004 04:55:42 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: slurp not working? ideas please!
Message-Id: <c6fgce$8jka8$1@ID-231055.news.uni-berlin.de>

Also sprach Geoff Cox:

> On 24 Apr 2004 04:54:16 GMT, "Tassilo v. Parseval"
><tassilo.parseval@rwth-aachen.de> wrote:
> 
> 
>>For one, it would help to remove the File::Find dependecy and post code
>>that only works on one input file. That way, someone could put the input
>>file and the two other files opened by your program into one directory.
> 
> Tassilo,
> 
> OK - have tried to follow your suggestions in cutting down the code
> etc.

Thank you. I can now run it without going through any hoops.

> The code and the 3 files test.htm, db.txt and allphp2.php can be in
> the same folder. The results will appear in results.htm. Hope this can
> allow you to see why the oder in results.htm is not the same as that
> in test.htm ...

After running your script, the results.htm I get is this:

    <html><head><title>test</title>
	</head><body> 
    <table width='100%' border='1'> 
    <h2>Finance </h2> 
    <p> description re Finance document</p> 
    <td valign='top'> 
    <a href="docs/gcse/student-activities/finance/finance-doc1.zip">Document1</a><br>
    [...]
    <a href="docs/gcse/student-activities/finance/finance-doc8.zip">Document8</a><br>
    </td></tr>
    <h2>Marketing</h2> 
    <p> description re marketing document </p> 
    <td valign='top'> 
    <a href="docs/gcse/student-activities/marketing/marketing-doc1.zip">Document1</a><br>
    [...]
    <a href="docs/gcse/student-activities/marketing/marketing-doc11.zip">Document11</a><br>
    </td></tr>
    </body></html> 

Considering the input:

> -------------- test.htm ----------------------
> 
><html>
><head><title>test</title>
></head>
><body>
> 
><h2>Finance </h2>
> 
><p> description re Finance document</p>
> 
><option
> value="docs/gcse/student-activities/finance">Marketing</option>
> 
><h2>Marketing</h2>
> 
><p> description re marketing document </p>
> 
><option
> value="docs/gcse/student-activities/marketing">Marketing</option>
> 
></body>
></html>

the order of the output looks correct to me. It's <h2>, <p> and finally
all the <a>'s. That's what I would expect when looking at your code.

If you have a different order, then it could have something to do with
buffering and output not happening in the order of the print()
statements. That would be a bit odd as each string you print is
terminated with a newline so buffering should not be an issue in this
case. But one never knows.

Can you try to enable autoflush on your output handle?

    package main;
    use IO::Handle;

    open OUT, ">>results.htm" or die $!;
    OUT->autoflush(1);
    
    ...

This will tell perl to do a flush after each print(). Does this help?

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6460
***************************************


home help back first fref pref prev next nref lref last post