SInce you are running with strict, then all your variables would need to be 
fully gualified(ie, $main::a, $main::word, etc) or if you add my to each variable, 
then it would work.

Wags ;)

-----Original Message-----
From: rabs [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 12, 2002 17:01
To: [EMAIL PROTECTED]
Subject: Another simple program which wont work.


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.





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

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

Reply via email to