foreach my $stat (readdir ISSUE) {
next if $stat =~ m/^0\./; # ignore 0.tiff et cetera
next if $stat =~ m/^\.\.?/; # ignore current and parent direct
+ory
next unless defined $stat;
warn "$stat\n" if $debug;
if ($stat =~ m/tiffcheck/) { # line 50
open TIFF, "$logdir/$issue/$stat"
or die "could not open $logdir/$issue/$stat: $!\n";
foreach my $line (<TIFF>) {
next if $line =~ m/Starting/;
next unless defined $line;
if (($line =~ m/Completed/) and !$tiffcheck) {
$tiffcheck = (split / /, $line)[2];
}
else {
$tiffcheck = "E";
}
}
close TIFF or warn "error closing $logdir/$issue/$stat: $!\n
+";
}
produces this warning:
Use of uninitialized value in pattern match (m//) at summarizePg.pl li
+ne 50.
This code has been removed from its context, so please ignore missing curlies and stuff. I provided the additional code for an idea of what is being done here. What has baffled me here <!- i dont want to hear it, tilly... -> is that i feel like I have taken every precaution against undefined and uninitialized values in this snippet -- and yet the m// is finding it uninitialized? How can this be? Is there a difference between "uninitialized" and "undefined" and perhaps "false" (i.e., 0 or "0")?
I am completely at a loss as to what is wrong here.
Thanks,
brother dep.
update: tye and MeowChow were right. I was missing a ~ about 70 lines later in my code at an elsif. Damn difficult bug to track down!
--
Laziness, Impatience, Hubris, and Generosity.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|