CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [sfo_sc] Read a file from a specific line and extract something to another file: Edit Log



sfo_sc
Novice

Jan 19, 2005, 9:08 PM


Views: 2798
Re: [sfo_sc] Read a file from a specific line and extract something to another file

Whats wrong with this piece of code? I couldn't figure out.

Code
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.

Code
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.


(This post was edited by sfo_sc on Jan 19, 2005, 10:53 PM)


Edit Log:
Post edited by sfo_sc (Novice) on Jan 19, 2005, 9:12 PM
Post edited by sfo_sc (Novice) on Jan 19, 2005, 9:23 PM
Post edited by sfo_sc (Novice) on Jan 19, 2005, 10:34 PM
Post edited by sfo_sc (Novice) on Jan 19, 2005, 10:49 PM
Post edited by sfo_sc (Novice) on Jan 19, 2005, 10:51 PM
Post edited by sfo_sc (Novice) on Jan 19, 2005, 10:53 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives