- or download this
sub get_x {
my @x = qw( stuff );
return wantarray ? @x : \@x;
}
- or download this
return wantarray ? @x : \@x;
- or download this
return wantarray ? @x : $x[0];
- or download this
my $dewdrop_description = get_droplet();
$dewdrop_description->{substance} = 'water';
$dewdrop_description->{molecular_array} = get_moles( 'water' );
$dewdrop_description->{temperature} = 37;
- or download this
my $dewdrop_description = {
%{ get_droplet() },
...
molecular_array => get_moles( 'water' ),
temperature => 37,
};
- or download this
return wantarray ? @moles : \@moles;
- or download this
my ($scalar) = why();
- or download this
sub get_or_set {
my $self = shift;
...
return $self->{stuff};
}
- or download this
my @x = (); # but I thought it was qw( foo ) !
get_or_set( @x ); # set value