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 =