There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is a matter of simple debugging: Read the error message, look at the line in question, discover what variables are involved, put some warn statements here and there at places in your code where you believe the variables involved are being set or tested -- the warn statements should print the value of those variables, run your code, verify your assumptions. If the warning message seems cryptic, add "use diagnostics;" to the top of your script, and the warning will be explained to you in greater detail. Here's a trivial example of the "print statements" (or warn) style of debugging:
This sort of drudgery may seem tedious. You could, alternatively, read perldebtut to learn how to use the Perl debugger. But for now, warn is all you need to discover where you're going wrong. You really don't need us to follow those steps for you. You need to learn how to do them yourself so that you don't need to rely on PerlMonks every time a surprise comes your way. Learning debugging techniques is an essential part of the practice of programming. Dave In reply to Re: Set operations
by davido
|
|