Rabs wrote:
> 
> Hi  everyone Im trying to get this script to work, I am wondering if anyone
> in this group can help me.
> 
> #!/usr/bin/perl-w
> use strict;
> 
> @a= (1, 2, 3, 4);
> foreach $word(@a){
> print $word ;
> }
> 
> When I run this script I get the following error messages, can you  explain
> in simple english they mean . And provide a corrected script..please.
> 
> Global symbol "@a" requires explict package name at script.pl  line 4
> Global symbol "$word" requires explict package name at script.pl  line 5.
> Global symbol "@a" requires explict package name at script.pl  line 5.
> Global symbol "$word" requires explict package name at script.pl  line 6.
> Execution of  script.pl  aborted due to complilation errors.

use strict; requires you to declare all variables.

#!/usr/bin/perl-w
use strict;

my @a = (1, 2, 3, 4);
foreach my $word ( @a ) {
    print $word;
}



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to