[nick:~/monks]$ perl -Mstrict -Mwarnings -e"
my @foo; push @foo = {bar=>'baz'};
"
####
Useless use of push with no values at -e line 2.
push on reference is experimental at -e line 2.
Not an ARRAY reference at -e line 2.
####
#! perl
use strict;
use warnings;
my $cast = list_characters()->{'cast'};
print "The Human is $cast->{'Human'}->{'fname'} $cast->{'Human'}->{'lname'}.";
print " He is always displaying $cast->{'Human'}->{'characteristic'}.\n";
sub list_characters {
my $Guide;
$Guide->{'cast'}->{'Human'} = {
fname => 'Arthur',
lname => 'Dent',
characteristic => 'bewilderment',
};
$Guide->{'cast'}->{'Betelgeusian'} = {
fname => 'Zaphod',
lname => 'Beeblebrox',
characteristic => 'narcissism',
};
$Guide->{'cast'}->{'Robot'} = {
fname => 'Marvin',
lname => 'the Paranoid Android',
characteristic => 'depression',
};
return $Guide;
}
__END__
####
[09:07][nick:~/monks]$ perl 1139851.pl
The Human is Arthur Dent. He is always displaying bewilderment.