Whats wrong with this piece of code? I couldn't figure out.
while($file[$i] =~ m/^\t/ || $file[$i] =~ m/^Caused/
|| length($file[$i]) == 0 || $file[$i] =~ m/^\s/) {
push(@temp, $file[$i] . "\n");
$i++;
}
I keep getting "Use of uninitialized value in pattern match (m//) at ./logwatch.pl line 53, <SOURCE> line 274." and go into infinit loop. Please help.
It is complaining about the leading whitespace condition I just adding. If I remove that, the code will work.
Line 53 is the $i++, which doesn't make sense at all.
Here is the case where I want to capture to the file.
java.lang.InternalError: jzentry == 0,
jzfile = 135272768,
total = 390,
name = /opt/tomcat5/webapps/fsm.war,
i = 12,
message = invalid LOC header (bad signature)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:320)
I can capture the line start with tab no problem, but I couldn't get the lines start with space.