You need to declare each variable (scalar, array, or hash) with my
before you use them. This lets Perl know what scope they should have.
Example:
my @shrimp;
foreach(@shrimp){
my $prawn = 1;
do something...
}
-----Original Message-----
From: ZHAO, BING [mailto:[EMAIL PROTECTED]
Sent: Monday, October 10, 2005 3:35 PM
To: Perl Beginners List
Subject: hi
Hi,
I am doing this simple enough script, but somehow it
generates error:
<snip>
Global symbol "@shrimp" requires explicit package name at
./pdbReadbrk2000.pl line 19.
syntax error at ./pdbReadbrk2000.pl line 21, near "foreach @shrimp"
Global symbol "$to" requires explicit package name at
./pdbReadbrk2000.pl line 21.
<snip>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>