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

Re: How to make it simple?

by etcshadow (Priest)
on Mar 26, 2004 at 18:17 UTC ( [id://340099]=note: print w/replies, xml ) Need Help??


in reply to How to make it simple?

Above points perfectly good, but if you want to keep the variables named (at least in a sense), then use a hash and an array of keys:
my @names = qw( a b c d e f g ); my %var; @var{@names} = splice(@array, 0, 8); foreach my $name (@names) { $var{$name} =~ s/\.//g; } # now, you can reference what was $a in your old code as $var{a}, etce +tera
------------ :Wq Not an editor command: Wq

Log In?
Username:
Password:

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

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

    No recent polls found