I'm trying to declare a variable $log that is a reference to an array that 
will contain the small amounts of data that need to be logged throughout a 
backup script i'm working on. I'd like to declare this scalar reference in 
the BEGIN function, but i can't use it outside of the BEGIN function if i 
declare 'my $log' in BEGIN.

Hmmm.... And since BEGIN is the first function to be called (right??) how 
might i declare the scalar as global?

Well, actually, i just tried 'use vars qw($log)' and it seems to have solved 
that problem.

But! i also have a function being used to assign the reference to $log that 
will point to the log array, and it ?needs? to be prototyped before the call 
is made to it... and i just tried 'use subs qw(StartLog(...))' but it claims 
it still needs to be prototyped before the call.. i think.  

Any ideas?


I get this error after a call is made within BEGIN like such

# START PERL CODE

use strict;
use warnings;

use vars qw($log);
use subs qw(&StartLog(...));

 ...
 ...

BEGIN
{
        $log = &StartLog(...);
        ...
}

 ...
 ...

# END PERL CODE

(here's the error..)

        Undefined subroutine &main::StartLog called at localMysqlHotCopyToRemote.pl    
 
line 349.
        BEGIN failed--compilation aborted at localMysqlHotCopyToRemote.pl line 357.


If anyone could briefly explain what the differences are between calling a 
sub-routine with the amperstand '&' and without it. I remember reading about 
it somewhere... Does it have to do with my problem?

        Thanks a bundle (Bundle::CPAN!! HA HE HA! Damn, that was bad)
                -Chris

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

Reply via email to