Click to See Complete Forum and Search --> : ... requires explicit package name at line ...
Scriptage
05-27-2005, 10:05 AM
I'm using strict and warnings and recieved this message
Global symbol $credit requires explicit package name at line 1078...
The thing is there is no $credit variable at line 1078 or anywhere near infact.
Obviously sifting through 1500 lines of code isn't going to be pretty so is there anything that can cause this, ie a missing curly bracket etc (although I would have thought that this would have caused more errors)
Any thoughts would be appreciated.
Regards
Carl
Jeff Mott
05-27-2005, 11:45 AM
Is there a double quoted string on that line perhaps? Is a $ you intented as a literal character being interpreted as the beginning of a variable?
Nedals
05-27-2005, 07:40 PM
Is line 1078 the beginning of a here-is structure? If you have an un-declared variable within a here-is structure, the line reported will be at the beginning of that structure.
Jeff Mott
05-27-2005, 08:04 PM
a here-is structureYou mean a here-doc structure?
http://perldoc.perl.org/perlop.html#%26lt%3b%26lt%3bEOF
Nedals
05-27-2005, 08:38 PM
Yes!
I've seen it written both ways.
The 0'Reilly Pocket Reference mentions both here-is and here-doc
symantics! *sigh*
Jeff Mott
05-27-2005, 11:34 PM
The 0'Reilly Pocket Reference mentions both here-is and here-docI wonder if this is actually a mistake in the book. I've searched the Perl manual, the books Programming Perl and Perl Cookbook (both of which are authored by people directly involved with the development of Perl), and googled perl.com and perl.org. All used the name "here-document" and none referenced a "here-is".
Scriptage
05-29-2005, 07:17 AM
Cheers guys I'll have a look at it on Tuesday and let you know. Sounds like you've solved my problem.
Thanks again.
Regards
Carl.
Scriptage
05-31-2005, 04:03 AM
Hi again. Thanks for the help, it did solve my problem... I declared my variable inside the here-doc (by accident) no wonder I couldn't figure out what was going on heh.
Thanks again.
Regards
Carl