Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: declaring same variable

by aging acolyte (Pilgrim)
on Jan 20, 2004 at 17:22 UTC ( #322641=note: print w/ replies, xml ) Need Help??


in reply to declaring same variable

Just declare my @xxx once.

my $op = "numbers"; # for example my @xxx = qw(one two three) if ( $op eq "numbers" ); @xxx = qw(four five) if ( $op eq "alpha" ); @xxx = qw(six ten) if ( $op eq "alp" ); print "@xxx\n";
results in: one two three

A.A.


Comment on Re: declaring same variable
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (16)
As of 2014-07-14 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (268 votes), past polls