Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Dereference string in foreach

by Anonymous Monk
on Feb 13, 2013 at 20:02 UTC ( #1018620=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $sref = \$string;
    foreach $string ( @array_of_strings ) {
        print $$sref;
    }
    
  2. or download this
    $sref \$string1;
    foreach $string2 ( @array_of_strings ) {
        $string1 = $string2;
        print $$sref;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-12-19 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls