Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2017-06-28 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (640 votes). Check out past polls.