Perl help needed please.

Jason Gurtz jason at tommyk.com
Sun Jul 25 15:45:29 PDT 2004


On 7/25/2004 18:07, S. Anthony Sequeira wrote:

> Thanks, I may check them out, but AFAICT this is a design problem (not
> catering for specific circumstances), rather than a programming bug.

ya, yer probably right.  OTOH, it's probably not a *serious* design
problem either.  I see a similar error [1] every 30 min from a cron job
script and I'm just too G.D. lazy to fix it


125: sub generateReport {
126: # ($test1, $test2, $result1, $result2, $subj, $body, $date1,
       $date2) = @_;
127:
128:    # If test2 == null, set to 3 so things are kosher
129:    if ($_[1] eq "") {
            Do stuff...
        }

Basically, most of the time a second test (which would result in a
$test2 value) is never run because the frame relay link is doing OK.  In
this case line 129 returns true but is not quite correct due to $test2
not existing.  I think I remember trying to change it to something like
"if (! $_[1]) { Do Stuff... }" and that indeed fixed the "uninitialized"
problem but had some sort of other negative consequence due to a, like
you say, "design problem"  ;)

Hrm, maybe it's time to redesign that little POS.  Possibly a

    my $test2="";

at the top would fix things due to the messy (but damned convenient)
perl global scope.

Cheers,

~Jason

-- 
[1] Use of uninitialized value in string eq at /home/flake/bin/chkId.pl
line 129.



More information about the lfs-chat mailing list