Hey. In Python I can do this:
def fnuh():
a = "foo"
b = "bar"
return a,b
Can I return a list in a similarly elegant way in perl, especially when the return type of the subroutine should be a reference to an array?
I know I can do
sub fnuh {
my $a = "foo";
my $b = "bar";
my $return = [];
push (@{$return}, $a);
push (@{$return}, $b);
return $return;
}
But I bet there is a better way to do that in Perl. Do you know it?