
greent76
New User
Mar 30, 2005, 9:55 PM
Post #1 of 2
(215 views)
|
|
Why is there no error for "use strict"?
|
Can't Post
|
|
I've been messing around with packages and modules and trying to get variables accessible between them. However, I had a typo which I thought that the "use strict" pragma would have caught. My simple script looks like this: use strict; print "Test variable: $not::here\n"; When I run "perl -c" on it, this is perfectly acceptable syntax, however I never tried to "use" the "not" package as indicated here. Why isn't this an error with "use strict"? And is there another way to detect such an error? Should I get something that says I've tried to access a variable from another package which is not in use in the script? (Using "warnings" in this case tells me that I've used this only once....and that is better, but still isn't good enough...I could use it twice and then that doesn't show up either!) Any ideas? Thanks! -Mark
|