>Periodically and *not* at the same point in the program each time the
script will fail with an “undefined subroutine &main::sLogData”, this after
it’s successfully >called it 20 or 30 times before…

Undefined errors could come from scoping issues or if you undef the routine.
Do you have a variable by the same name?  We can only guess without the part
that is actually failing:  the “interfaces to some National Instruments
hardware (which is working fine) and iterates over several options (also
working fine)” I what we need to see.  


-Wayne
--
Software Engineer
InterSystems USA, Inc.
303-858-1000
  
________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Labelle,
Marc S
Sent: Monday, June 30, 2008 12:25 PM
To: [email protected]
Subject: getting "undefined subroutine &main::sLogData" after
callingsuccessfully multiple times in script.

Hello all,
            I’m a bit confounded by the error I’m getting.
I’ve got a small subroutine (listed below) that I call when I need to post
data to both the console and a logfile.
It is using two globals and one variable passed to it (globals are a flag to
enable/disable the logfile, and the filehandle).
It’s a dead simple subroutine and I don’t know what I’m doing wrong.
Basically the script interfaces to some National Instruments hardware (which
is working fine) and iterates over several options (also working fine).  As
it goes it logs results, data, etc.
Periodically and *not* at the same point in the program each time the script
will fail with an “undefined subroutine &main::sLogData”, this after it’s
successfully called it 20 or 30 times before…

Any thoughts?
Cheers,
-Marc


sub sLogData(@)
{
            my $string=$_[0];
            print "$string";
            if ($flag_log) {print LOGFILE "$string"; }
            return(0);
}




_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to