Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: symbolic references

by tall_man (Parson)
on Sep 27, 2005 at 19:21 UTC ( #495517=note: print w/ replies, xml ) Need Help??


in reply to symbolic references

Here's another way. The "foreach" statement automatically aliases the loop variable to the items in the list, so you could just do:

use strict; my $varA = "this is varA"; my $varB = "this is varB"; my $varC; print "\n"; foreach my $f ($varA, $varB, $varC) { if ( defined $f ) { print "--- $f \n"; my $tmp = $f . " and some more "; print "----- $tmp \n"; $f = $tmp; print "===== $f \n"; } } print "\n"; foreach my $f ( $varA, $varB, $varC ) { print "+ $f \n"; } print "\n";


Comment on Re: symbolic references
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (20)
As of 2015-07-06 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (74 votes), past polls