Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Binding within a sub

by Eily (Monsignor)
on Apr 18, 2018 at 08:04 UTC ( [id://1213107]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for my $text ( qw( one two three four five six seven eight nine ten ) 
    +)
    {
      my $uniq_text = $text; # Copy
      ... # Your code, where $uniq_text is a new variable that was never u
    +sed before, and noone else has access to.
    }
    
  2. or download this
    sub InitializeList {
      my @items; # no need to undef it
      for my $text ( qw( one two three four five six seven eight nine ten 
    +) )
    ...
    }
    
    my @res = InitializeList(); # get the items from that call
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2024-04-23 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found