in reply to Count the number of return values from a subroutine
puts out:#!/usr/bin/perl -w use strict; $|++; use Data::Dumper; sub foo { [5, 3], 17 }; my $count = my (@values) = foo(); print $count, "\n"; print Dumper @values;
but this line: my $count = my (@values) = foo(); is ugly, usually i'd declare the variables first.2 $VAR1 = [ 5, 3 ]; $VAR2 = 17;
~Particle
|
|---|