getting "undefined subroutine &main::sLogData" after calling
am 30.06.2008 20:25:05 von marc.s.labelleThis is a multi-part message in MIME format.
--===============0382402955==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C8DADE.9EBE8466"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C8DADE.9EBE8466
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
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...
=20
Any thoughts?
Cheers,
-Marc
=20
=20
sub sLogData(@)
{
my $string=3D$_[0];
print "$string";
if ($flag_log) {print LOGFILE "$string"; }
return(0);
}
=20
=20
------_=_NextPart_001_01C8DADE.9EBE8466
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
xmlns=3D"http://www.w3.org/TR/REC-html40">
charset=3Dus-ascii">
style=3D'font-size:10.0pt;
font-family:Arial'>Hello all,
style=3D'font-size:10.0pt;
font-family:Arial'> =
I’m
a bit confounded by the error I’m =
getting.
style=3D'font-size:10.0pt;
font-family:Arial'>I’ve got a small subroutine (listed below) that =
I call
when I need to post data to both the console and a =
logfile.
style=3D'font-size:10.0pt;
font-family:Arial'>It is using two globals and one variable passed to it
(globals are a flag to enable/disable the logfile, and the =
filehandle).
style=3D'font-size:10.0pt;
font-family:Arial'>It’s a dead simple subroutine and I don’t =
know
what I’m doing wrong.
style=3D'font-size:10.0pt;
font-family:Arial'>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.
style=3D'font-size:10.0pt;
font-family:Arial'>Periodically and *
style=3D'font-weight:bold'>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…
style=3D'font-size:10.0pt;
font-family:Arial'>
style=3D'font-size:10.0pt;
font-family:Arial'>Any thoughts?
style=3D'font-size:10.0pt;
font-family:Arial'>Cheers,
style=3D'font-size:10.0pt;
font-family:Arial'>-Marc
style=3D'font-size:10.0pt;
font-family:Arial'>
style=3D'font-size:10.0pt;
font-family:Arial'>
style=3D'font-size:10.0pt;
font-family:Arial'>sub sLogData(@)
style=3D'font-size:10.0pt;
font-family:Arial'>{
style=3D'font-size:10.0pt;
font-family:Arial'> =
my
$string=3D$_[0];
style=3D'font-size:10.0pt;
font-family:Arial'> =
print
"$string";
style=3D'font-size:10.0pt;
font-family:Arial'> =
if
($flag_log) {print LOGFILE "$string"; =
}
style=3D'font-size:10.0pt;
font-family:Arial'> =
return(0);
style=3D'font-size:10.0pt;
font-family:Arial'>}
style=3D'font-size:10.0pt;
font-family:Arial'>
style=3D'font-size:
12.0pt'>
------_=_NextPart_001_01C8DADE.9EBE8466--
--===============0382402955==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0382402955==--