'use strict; use warnings; my $foo=[1,2]; foreach my $bar (@{$foo}) { print "bar is $bar\n"}' bar is 1 bar is 2