Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

map and regexp. An newbie question

by nando (Acolyte)
on Oct 19, 2011 at 06:37 UTC ( [id://932303]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @numero = (1..100);
    my %lista = map{$_,$_*2} @numero;
    while (($num, $doble)= each(%lista)) { print "$num .... $doble\n";}
    
  2. or download this
    my @palabras = qw ( arriba abajo contigo compaņero cariņo superfluo vi
    +da);
    my %cosa = map {$_, $_=~s/a/X/g} @palabras;
    while (($uno, $dos)=each(%cosa)){print "$uno...$dos\n";}
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-20 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found