neat code snippet

unixdown unixdown at unixdown.com
Thu Sep 20 15:42:46 CDT 2001


That is rather nifty.
I'm used to using $#foo for the element count.
Now I rather curious to see what the processing differences are between:
scalar(@array)
$feh = @foo = `dir`;
and
$#array
Well, suppose I should go to the monastery.

At 02:55 PM 9/20/01 -0500, you wrote:

>Ran across something like this(here's a cleaner example), and I had to 
>devote a few minutes of admiration to it.  I had always used 
>scalar(@array) to get the count of elements in an array, but never 
>considered combining multiple assignments of different contexts into one line
>
>   $feh = @foo = `dir`;
>
>   print "There are $feh lines of output, and here they are:\n", @foo;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/archives/bloomington-normal-pm/attachments/20010920/3e7fe2d8/attachment.htm


More information about the Bloomington-normal-pm mailing list