Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Mapping Array

by pg (Canon)
on Oct 29, 2005 at 22:54 UTC ( [id://503925]=note: print w/replies, xml ) Need Help??


in reply to Mapping Array

use strict; use warnings; my @vars = (1,2,3); my ($str1, $str2, $str3) = map {"string" . $_} @vars; print $str1, "\n"; print $str2, "\n"; print $str3, "\n";

Also you don't need @vars, just:

my ($str1, $str2, $str3) = map {"string" . $_} @_;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-24 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found