in reply to List-to-Scalar Function?
Your third one is problematic. "null" in what sense? And yes, $~ does already have a meaning. Everything means something. That's why they used up almost all the control-character names and are now started on the multicharacter names in 5.6.1.use List::Util qw(reduce); # from the CPAN my $max = reduce { $a > $b ? $a : $b } @list; my $string = reduce {$a . $b } @list;
-- Randal L. Schwartz, Perl hacker
my $count = reduce { $a + $b =~ /the/ } 0, <FILE>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: List-to-Scalar Function?
by tilly (Archbishop) on May 09, 2001 at 03:27 UTC | |
by merlyn (Sage) on May 09, 2001 at 03:55 UTC | |
|
Re: Re: List-to-Scalar Function?
by MrNobo1024 (Hermit) on May 09, 2001 at 02:36 UTC |