- or download this
sub test {
my @rv = $_[0] =~ /^([0-9]+)$/;
print "<<@rv>>\n";
return @rv[ 0 .. $#rv ];
}
- or download this
<<>>
[[]
...
[123]
<<123>>
[123]
- or download this
sub test {
my @rv = $_[0] =~ /^([0-9]+)$/;
...
return wantarray? @rv: $rv[-1];
}
- or download this
michael$ perl t.pl
<<>>
...
[123]
<<123>>
[123]