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 says what it is doing.

The idea with '}{' is brilliant in my opinion. See the "-p" switch explaination in perldoc perlrun:


http://www.perldoc.com/perl5.8.0/pod/perlrun.html#-p

and substitute the "..." with }{*_=*.}{ to see how it works. Hint: it's the same as:

perl -lpe '}{$_=$.}{'

As for the code that says what it is doing, here it is:

perl -le 'while(<>){} print $.'

Do nothing for every line of input and print the number of lines, just like "wc -l" would.

--
ZSDC


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to