for ($i=0; $i<@vars; $i++) { print $var[$i]{num}, '||', $var[$i]{txt}, "\n"; } #### foreach (@vars) { { print $_->{num}, '||', $_->{txt}, "\n"; }