JRepici
09-06-2002, 10:52 PM
. . . . . . . . . . .
I remember feeling "holier-than-thow" toward the "all warnings off" programmers in my shop once. They'd turn "all warnings ON" just to, maybe dip a toe in those waters and get a scrolling screen for the next 15 seconds.
I, who always compiled all my C programs with ALL WARNINGS ON, and sometimes even brought my own lint from home, felt so smug, dare I say it, even superior. Perhaps this is penance then.
To learn Perl, I left all that stuff off the table. Didn't want it to clutter up the learning process early on the shallow part of the curve. Well, now I'm paying the price. If it hadn't been for the logs shutting off when there are too many errors, I'm quite sure I would have seen a 15 second scrolling screen.
First warnings
I got Pools or warnings, and that starts with 'P' and that... well you know the rest...
First. I can't seem to get "use warnings;" to work at all. It says it can't find the module "warnings.pm" in the path.
If I use warnings from the command line ('-w') I get warnings. Some are easy enough to solve, but others...
******* How do I suppress the "used only once" warning without doing too much confusing code around the configuration variables (they need to stay tidy for the user)
******* Uninitialized variables in C are those that are used before they've been on the left side of an assignment op. This does not seem to be the case in Perl. I get the warning, even if it is assigned directly above the statement that throws the warning. Sometimes it seems to just make no sense at all It seems to be mixed up with the %ENV hash somehow, but I can't make it out. And how about this, it gives me an un-unit'd variable on a 'print <<EOF;' statement ???
Now for 'strict'
The 'use strict;' pragma works just fine but it produces too many errors to list.
On the one I saw a lot of however, I' have a question:
When it says:
******* "$SomeVariableID" requires explicit package name at ..."
What does this mean. I thought everything was assumed to be in main if it doesn't have a package name? I've seen a lot of scripts with configuration variables and none of them ever included a package name before the variables. WTF?
A real-world question
I give my script to geek-b (me being geek-a of course) and he runs it on a MAC and it tells him that a function called in the code could not be found.
Yep, that function call is in the code, inside a function named OldDontUse(); that is itself never called.
The question: What is it about his system that allows him to catch (die over) this non-existent function-call at compile time even though it is never actually called at run time?
Put another way, how can I catch this at compile time?
also...
Are there more errors like this that will cause scripts to stop running on some systems while they run just fine on others?
. . . . . . . . . . .
Well, that's about it for now. As always I really appreciate all the expert help I get from you gurus on the FutureQuest staff and from all the guru-level site owners around here.
Thank you.
-John
I remember feeling "holier-than-thow" toward the "all warnings off" programmers in my shop once. They'd turn "all warnings ON" just to, maybe dip a toe in those waters and get a scrolling screen for the next 15 seconds.
I, who always compiled all my C programs with ALL WARNINGS ON, and sometimes even brought my own lint from home, felt so smug, dare I say it, even superior. Perhaps this is penance then.
To learn Perl, I left all that stuff off the table. Didn't want it to clutter up the learning process early on the shallow part of the curve. Well, now I'm paying the price. If it hadn't been for the logs shutting off when there are too many errors, I'm quite sure I would have seen a 15 second scrolling screen.
First warnings
I got Pools or warnings, and that starts with 'P' and that... well you know the rest...
First. I can't seem to get "use warnings;" to work at all. It says it can't find the module "warnings.pm" in the path.
If I use warnings from the command line ('-w') I get warnings. Some are easy enough to solve, but others...
******* How do I suppress the "used only once" warning without doing too much confusing code around the configuration variables (they need to stay tidy for the user)
******* Uninitialized variables in C are those that are used before they've been on the left side of an assignment op. This does not seem to be the case in Perl. I get the warning, even if it is assigned directly above the statement that throws the warning. Sometimes it seems to just make no sense at all It seems to be mixed up with the %ENV hash somehow, but I can't make it out. And how about this, it gives me an un-unit'd variable on a 'print <<EOF;' statement ???
Now for 'strict'
The 'use strict;' pragma works just fine but it produces too many errors to list.
On the one I saw a lot of however, I' have a question:
When it says:
******* "$SomeVariableID" requires explicit package name at ..."
What does this mean. I thought everything was assumed to be in main if it doesn't have a package name? I've seen a lot of scripts with configuration variables and none of them ever included a package name before the variables. WTF?
A real-world question
I give my script to geek-b (me being geek-a of course) and he runs it on a MAC and it tells him that a function called in the code could not be found.
Yep, that function call is in the code, inside a function named OldDontUse(); that is itself never called.
The question: What is it about his system that allows him to catch (die over) this non-existent function-call at compile time even though it is never actually called at run time?
Put another way, how can I catch this at compile time?
also...
Are there more errors like this that will cause scripts to stop running on some systems while they run just fine on others?
. . . . . . . . . . .
Well, that's about it for now. As always I really appreciate all the expert help I get from you gurus on the FutureQuest staff and from all the guru-level site owners around here.
Thank you.
-John