Is all your code in a single file? Or are you splitting it into separate files 
for convenience? I found that I have to replicate the 'use vars <globals>' 
statement in each separate file I use. It doesn't give me any complaints 
about the code being broken up but it does complain if I don't tell each file 
about the globals.

John


On Wednesday 18 September 2002 03:13 pm, Stephen Bardsley spewed into the 
ether:
> Well, I'm not out of the woods yet...
>
> I am still experiencing a problem with globals not
> being defined in some subs, and all of this is in
> global.asa.  The very simple example below shows
> the layout, and an explanation below that...
>
> global.asa
> ==========================
>
> use vars qw( $v );
>
> sub Script_OnStart {
>     init();
>     dothis();
>     dothat();
> }
>
> sub init {
>     $v = new myModule();
> }
>
> sub dothis {
>     $v->foo();
> }
>
> sub dothat {
>     $v->bar();
> }
>
> ==========================
>
> I consistently get a 'Can't call method "bar" on and
> undefined value' error in dothat().  Where dothis()
> seems to work fine.
>
> I have UseStrict=1, Debug=-3 and PerlWarn=1, and
> see nothing leading up to the error.  I have tried
> this with Apache::ASP v2.37 and v2.39 running under
> Apache 1.3.26 / mod_perl 1.27 / perl 5.6.1
>
> Please help before my hair is totally gone.
>
> Regards,
> Steve
> _____________________
> Stephen Bardsley
> RLW Inc.
> Malta, NY
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 

--------------------------------------------------------------------------------
Check out http://www.Wizard.Org for great deals on Electronic Parts
*NEW* Computer Parts & Accessories - Drives - LCD - Systems - Linux
--------------------------------------------------------------------------------
** Affordable Online Store w/Merchant Card Processing & Paypal **
Write to us: [EMAIL PROTECTED]  --  Get your Store Online Today!
--------------------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to