[ create a new paste ] login | about

Link: http://codepad.org/D2Aa74nZ    [ raw code | output | fork ]

Perl, pasted on Jun 23:
1
2
3
4
5
6
7
8
9
10
11
12
 use warnings;
    
    my @a = (1, 2, 3, 4, 5);
    
    for $x (@a)
    {
        print $x*=2;
        print "\n";
    }

    print "outside the loop \n";
    print "@a";


Output:
1
2
3
4
5
6
7
2
4
6
8
10
outside the loop 
2 4 6 8 10


Create a new paste based on this one


Comments: