Why didn't 'use strict' catch this error?
From: Rob Richardson (interrobang_at_yahoo.com)
Date: 05/31/04
- Previous message: Randy W. Sims: "Re: Any wrong?"
- Next in thread: Paul Johnson: "Re: Why didn't 'use strict' catch this error?"
- Reply: Paul Johnson: "Re: Why didn't 'use strict' catch this error?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 16:57:36 -0700 (PDT) To: beginners@perl.org
Greetings!
I found the source of the "impossible error". Here are the lines that
caused it:
my $userList = new UserList($userFile);
my $user = UserList->GetUser($logname);
I have a "use UserList" line near the top of this file. I also have
"use strict" and "use warnings".
I would have expected Perl to complain about the bareword "UserList" in
the second line, or find some other way to complain about it. Instead,
it merrily tried to execute this line, and threw the error message
halfway through the GetUser() function in the UserList package. Why
didn't an error get thrown? If this is a valid construct in Perl, how
is it supposed to be used?
Thanks again!
Rob Richardson
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
- Previous message: Randy W. Sims: "Re: Any wrong?"
- Next in thread: Paul Johnson: "Re: Why didn't 'use strict' catch this error?"
- Reply: Paul Johnson: "Re: Why didn't 'use strict' catch this error?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|