in reply to Re: What's wrong with my code? [from a beginner]
in thread What's wrong with my code? [from a beginner]

That is just plain wrong. see this code:
my @array = (1,2,3); test (); sub test { print $array[0]; } #prints 1

holli, regexed monk