I'm experiencing a scope problem that I can't figure out. I'm using warnings, and I get the following warning: "Use of uninitialized value $f1missing in numeric eq (==) at C:\scripts\DailyComp2.7.pl line 520 (#1)" At this point in the script, I'm using NET::Telnet and I'm in a telnet session. Here's the chunk of code that's producing the warning:
# Check for error that first input file can't be found my $f1missing = 0; $f1missing = $t->waitfor(String => 'That file is unavailable', errmode => 'return'); if ($f1missing == 1) { print "\nFirst input file $prevcomp is missing!!\n"; $t->print(); # Send Enter for prompt $t->print(); # Send Enter to exit COMPARE $CTYPE = 0; # Set Compare type back to 0 to avoid running COMPARE r +eport again $ETYPE = 1; # Set error type to 1 return; # Exit subroutine }
I initialize the value right before I use it in the if function, so why would it produce an uninitialized value warning here? As always, any help would be appreciated.
In reply to Scope Issue by MKJ747
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |