RE: Count the number of lines in a file without actually iterating through the file

2004-02-25 Thread David le Blanc
> -Original Message- > From: Jason Normandin [mailto:[EMAIL PROTECTED] > Sent: Thursday, 26 February 2004 10:56 AM > To: Perl Beginners > Subject: Count the number of lines in a file without actually > iterating through the file > > Hi List. > > > > Is there a way to determine the nu

Re: Count the number of lines in a file without actually iterating through the file

2004-02-25 Thread John W. Krahn
Jason Normandin wrote: > > Hi List. Hello, > Is there a way to determine the number of lines in a file without actually > iterating through the file and incrementing a file? > > I found the following on perlmonks.org, it works great but this is command > line syntax > > perl -lpe '}{*_=*.}{' f

Re: Count the number of lines in a file without actually iterating through the file

2004-02-27 Thread Bryan Harris
>> perl -lpe '}{*_=*.}{' file > > Ooh, an obfuscated verbose way of writing: > > perl -lpe'}{$_=$.' file Huh? Could someone explain this? The "}{" makes no sense to me... - B -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Count the number of lines in a file without actually iterating through the file

2004-02-27 Thread Wiggins d Anconia
> > > >> perl -lpe '}{*_=*.}{' file > > > > Ooh, an obfuscated verbose way of writing: > > > > perl -lpe'}{$_=$.' file > > > Huh? Could someone explain this? The "}{" makes no sense to me... > > - B You're not the first. There was recently much discussion about this on the Fun with Perl l

Re: Count the number of lines in a file without actually iterating through the file

2004-02-27 Thread James Edward Gray II
On Feb 27, 2004, at 1:13 PM, Bryan Harris wrote: perl -lpe '}{*_=*.}{' file Ooh, an obfuscated verbose way of writing: perl -lpe'}{$_=$.' file Huh? Could someone explain this? The "}{" makes no sense to me... I thought the same thing, when I read it! I'm still not sure I get it, but perlrun

Re: Count the number of lines in a file without actually iterating through the file

2004-02-27 Thread R. Joseph Newton
Bryan Harris wrote: > >> perl -lpe '}{*_=*.}{' file > > > > Ooh, an obfuscated verbose way of writing: > > > > perl -lpe'}{$_=$.' file > > Huh? Could someone explain this? The "}{" makes no sense to me... Well, as Momma used to say: "Just look the other way. Ignore it, and maybe it will go awa

Re: Count the number of lines in a file without actually iterating through the file

2004-02-27 Thread zsdc
R. Joseph Newton wrote: Huh? Could someone explain this? The "}{" makes no sense to me... Well, as Momma used to say: "Just look the other way. Ignore it, and maybe it will go away..." I would not be at all surprised if the code above works, and does *something*. I just prefer to use code that

CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-27 Thread WC -Sx- Jones
R. Joseph Newton wrote: Bryan Harris wrote: perl -lpe '}{*_=*.}{' file Ooh, an obfuscated verbose way of writing: perl -lpe'}{$_=$.' file Huh? Could someone explain this? The "}{" makes no sense to me... Well, as Momma used to say: "Just look the other way. Ignore it, and maybe it will go a

Re: CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-27 Thread zsdc
WC -Sx- Jones wrote: Can we please leave the Perl Golf in the appropriate context or at least make a warning in/at the start of the message that the post may confuse beginners? I didn't make any warning in my last post. I wrote an explaination instead. I hope that's acceptable... -- ZSDC -- To

Re: CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-27 Thread WC -Sx- Jones
zsdc wrote: WC -Sx- Jones wrote: Can we please leave the Perl Golf in the appropriate context or at least make a warning in/at the start of the message that the post may confuse beginners? I didn't make any warning in my last post. I wrote an explaination instead. I hope that's acceptable...

Re: CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-27 Thread John W. Krahn
Wc -Sx- Jones wrote: > > Most employers (and a quiet a few IT managers) are not very Perl savvy > and would like you Perl people (read POD) to be more like COBOL people > (read BOOKS.) Don't you mean "we Perl people" or are you inferring that you are not "a Perl person?" > Can we please leave th

Re: CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-28 Thread WC -Sx- Jones
John W. Krahn wrote: Wc -Sx- Jones wrote: Most employers (and a quiet a few IT managers) are not very Perl savvy and would like you Perl people (read POD) to be more like COBOL people (read BOOKS.) Don't you mean "we Perl people" or are you inferring that you are not "a Perl person?" I apologize

Re: CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-28 Thread R. Joseph Newton
WC -Sx- Jones wrote: > R. Joseph Newton wrote: > > Bryan Harris wrote: > > > > > perl -lpe '}{*_=*.}{' file > >>> > >>>Ooh, an obfuscated verbose way of writing: > >>> > >>>perl -lpe'}{$_=$.' file > >> > >>Huh? Could someone explain this? The "}{" makes no sense to me... > > > > > > Well, as

Re: CODING STYLE (was Re: Count the number of lines in a file without actually iterating through the file)

2004-02-29 Thread zsdc
WC -Sx- Jones wrote: zsdc wrote: WC -Sx- Jones wrote: Can we please leave the Perl Golf in the appropriate context or at least make a warning in/at the start of the message that the post may confuse beginners? I didn't make any warning in my last post. I wrote an explaination instead. I hope