Same thing...#!/usr/bin/perl use strict; my @array = qw(one two three four); print "Foreach:\n"; foreach my $item (@array) { print "$item\n"; } print "\nFor:\n"; for my $item (@array) { print "$item\n"; }
In reply to Re: for, foreach: any difference?
by saberworks
in thread for, foreach: any difference?
by muba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |