in reply to Re: foreach in array
in thread foreach in array

You probably meant to quote the @:

print "elements in \@data: ", scalar( @data ), $/;

Perl is environmentally friendly - it saves trees