Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 exploiting the Monastery: (5)
As of 2014-09-17 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (65 votes), past polls