This idiom gives you the number of return values from a subroutine. (Courtesy of P5P)
my $count = () = function(); print $count; # $count is '5' sub function { return qw(a b c d e); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Count the number of return values from a subroutine
by ariels (Curate) on Jul 09, 2001 at 16:07 UTC | |
Re: Count the number of return values from a subroutine
by particle (Vicar) on Jul 09, 2001 at 16:57 UTC | |
Re: Count the number of return values from a subroutine
by tomhukins (Curate) on Jul 09, 2001 at 15:58 UTC | |
by thpfft (Chaplain) on Jul 11, 2001 at 01:22 UTC |
Back to
Cool Uses for Perl