Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 wandering the Monastery: (5)
As of 2015-07-05 14:30 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 (67 votes), past polls