in reply to Re^2: Counting the number of items returned by split without using a named array
in thread Counting the number of items returned by split without using a named array
GAWD! Well, the fact that you write "optimized" yourself suggests that it is really an unwanted side effect of an optimization... may I push it as far as to dare to say that it is a bug?
Well, another trick that I verified not to be flawed is:
my $count=map $_, split;
of course it doesn't just taste as good... hmmm, how 'bout:
my $count=+(split); # ?!?
(also verified!)
$ perl -lpe '$_=+(split)' foo 1 bar baz 2
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Counting the number of items returned by split without using a named array
by salva (Canon) on May 03, 2006 at 11:15 UTC | |
Re^4: Counting the number of items returned by split without using a named array
by BrowserUk (Patriarch) on May 03, 2006 at 12:32 UTC | |
by blazar (Canon) on May 03, 2006 at 12:41 UTC |