Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
No, that syntax cannot be right. Looking at the code you posted originally, I see:
You seem to be trying to use strict;, which is good (see my home node), but without understanding what it does. PerlIntro (http://perldoc.perl.org/perlintro.html#Variable-scoping) has a section on variable scoping that it might help you to understand. my creates a new instance of a variable. You may have seen examples of messages telling you that a declaration masks a previous declaration. This is telling you that you have re-initialised a variable name, which is unlikely to be what you want. I think what you want is something like:
but as I don't even know what LWP is, this is a pretty wild guess. http://search.cpan.org/~gaas/libwww-perl-6.04/lib/LWP/UserAgent.pm might be another good read. Regards, John Davies In reply to Re^3: Question regarding perl subroutine
by davies
|
|