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.
In reply to Re^4: globally seen variable
by vit
in thread globally seen vairable
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |