Christopher L Hood wrote:
Ok what I have is 3 variables assigned in the global block using my
then when I try to use those variables later in a subroutine I get
an error. The error is below:

Error during compilation of /usr/local/rt3/local/html/cgi-bin/aupsearch.cgi:
Variable "$ip" will not stay shared at /usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 141.
Variable "$date" will not stay shared at /usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 142.
Variable "$customer" will not stay shared at /usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 158.


Now it was my understanding that if I used my in the global block,
that I could reference that variable in a subroutine. OH, and
strict is on, and cannot be taken off.

First, you should look up the message in "perldoc perldiag".

Are you possibly running the program under mod_perl? I'm asking
because mod_perl may trigger that warning even without nested
subroutines.

One possible solution is to pass the variables as arguments when
calling the subroutine, instead of referring to them from inside the
sub.

HTH

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to