Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Counting variable initialization

by eric256 (Parson)
on Mar 29, 2005 at 19:34 UTC ( [id://443237]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    my @l = qw/10 20 30/;
    ...
    $t += $_ foreach @l;
    print '$t = ' . $t . "\n";
    print '$i = ' . $i . "\n";
    
  2. or download this
    use strict 'refs';
    my(@l) = ('10', '20', '30');
    ...
    $t += $_ foreach (@l);
    print '$t = ' . $t . "\n";
    print '$i = ' . $i . "\n";
    
  3. or download this
    $t = 60
    $i =
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-19 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found