Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by ikegami (Pope)
on Nov 24, 2004 at 19:55 UTC ( #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
Node Status?
node history
Node Type: note [id://410233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-06-30 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (400 votes). Check out past polls.