Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Problems with map(function, array)

by Redei (Initiate)
on Dec 10, 2012 at 21:00 UTC ( #1008163=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    sub my_uc {
        my $c = shift;
    @a = map my_uc, @a;
    print "==>@a<== my_uc,\n";
  2. or download this
    ==>A B C<== { uc($_) }
    ==>A B C<== { my_uc($_) }
    ==>A B C<== uc,
    ==>  <== my_uc,
  3. or download this
    sub my_new_uc {
        my $c = shift // $_;
    @a = map my_new_uc, @a;
    print "==>@a<== my_new_uc,\n";
  4. or download this
    ==>A B C<== my_new_uc,
    ==>  <== my_uc,
    ==>  <== my_new_uc,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008163]
Approved by davido
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2016-10-24 01:20 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.