O
Occidental
my @A = qw/one two three/;
print "A: ";
print join " ", @A;
print "\n";
my @A1 = map (ucfirst, @A);
print "A1: ";
print join " ", @A1;
print "\n";
my @A2 = map (reverse, @A);
print "A2: ";
print join " ", @A2;
print "\n";
my $y = reverse "one";
print "y: $y\n";
===============================================
gives:
A: one two three
A1: One Two Three
A2:
y: eno
===============================================
The first map operation works, and reverse works on a scalar, but the
array A2 is empty. Anyone know why?
print "A: ";
print join " ", @A;
print "\n";
my @A1 = map (ucfirst, @A);
print "A1: ";
print join " ", @A1;
print "\n";
my @A2 = map (reverse, @A);
print "A2: ";
print join " ", @A2;
print "\n";
my $y = reverse "one";
print "y: $y\n";
===============================================
gives:
A: one two three
A1: One Two Three
A2:
y: eno
===============================================
The first map operation works, and reverse works on a scalar, but the
array A2 is empty. Anyone know why?