Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Pearls (not really) of Perl programming

by ikegami (Patriarch)
on Nov 24, 2004 at 19:55 UTC ( [id://410233]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for my $i (1..10) {
       # some stuff with $i
    }
    
  2. or download this
    my $i;
    for $i (1..10) {
       # some stuff with $i
    }
    
  3. or download this
    {
       my $i;
    ...
          # some stuff with $i
       }
    }
    
  4. or download this
    for (int i=0, i<5; i++) {
       ...
    }
    // i in still in scope here!
    
  5. or download this
    foreach my $var ('a', 'b') {
       ...something that may modify $var...
       print($var);
    }
    
  6. or download this
    foreach ('a', 'b') {
       my $var = $_;
       ...something that may modify $var...
       print($var);
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-18 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found