Help for this page

Select Code to Download


  1. or download this
    my @foo = (2, 4, 8);
    foreach my $num (@foo) {
        $num *= 2;
    }
    $, = ",";print @foo;print "\n";
    
  2. or download this
    my @foo = (2, 4, 8);
    foreach my $num (@foo) {
    ...
        $_[0] =  2*$_[0];  
        return $_[0];
    }
    
  3. or download this
    sub double {
        my $num = $_[0];
        $num =  2*$num;  
        return $num;
    }