Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Array slice vs foreach and push

by vinian (Beadle)
on Nov 10, 2011 at 11:00 UTC ( [id://937329]=note: print w/replies, xml ) Need Help??


in reply to Array slice vs foreach and push

perl -w -le 'my @chars = qw( a b c ? : ! f g ); my @up_chars = map { tr/a-z/A-Z/; $_ } @chars; print "@up_chars"'

hope this would help.

Replies are listed 'Best First'.
Re^2: Array slice vs foreach and push
by jwkrahn (Abbot) on Nov 10, 2011 at 11:46 UTC

    my @up_chars = map { tr/a-z/A-Z/; $_ } @chars; can be reduced to: my @up_chars = map uc, @chars;

      nice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://937329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found