in reply to Re^3: globally seen variable
in thread globally seen vairable
in main program and tried to use it in package:our $ERROR_FILE = $cgi_dir."files/logs/errors.txt";
and it returnsuse strict; package RecordError; sub RecordError { my $error = shift; ## $ERROR_FILE is global var ## open OF, ">>$ERROR_FILE" or die "cannot open ERROR_FILE $ERROR_FILE\n" +; print OF "$error\n"; close OF; } 1;
What do I do wrong?Global symbol "$ERROR_FILE" requires explicit package name at E:/..... +./lib/RecordError.pm line 12.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: globally seen variable
by moritz (Cardinal) on Sep 29, 2010 at 08:41 UTC | |
|
Re^5: globally seen variable
by BrowserUk (Patriarch) on Sep 28, 2010 at 21:44 UTC | |
by vit (Friar) on Sep 28, 2010 at 22:11 UTC | |
by BrowserUk (Patriarch) on Sep 29, 2010 at 14:32 UTC |