Another great example of why it's important to actually paste the actual error message when asking a question.
Your error message was (when I pasted your code into my boilerplate)
Global symbol "$lparname" requires explicit package name at 1134744.pl
+ line 21.
Execution of 1134744.pl aborted due to compilation errors.
When it tells you that, it means you are using a variable that hasn't been declared. To you that doesn't make sense because you can't see the one-character typo no matter how long you stare at your screen. (If it sounds like I am speaking from experience, it is because I am speaking from experience.)
So you say to yourself "Self, I know I declared my $lparname, dammit! I'm off to PM to ask for help (without pasting the error message) ..."
NO!! Don't do it!
Instead, say to yourself, "Self, I know I declared my $lparname, dammit! But if Perl says I didn't, I guess the first thing to do is have look at the statement where I declared it." And then when you get there, you know there's going to be a typo, because Perl just told you, so you can see it!
HTH :-)
The way forward always starts with a minimal test.
|