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: Noob ? about Regular Expressions: Edit Log



200mg
New User

May 26, 2009, 7:52 AM


Views: 2267
Noob ? about Regular Expressions

I am trying to run winzip via command line and then parse the output for the word "Error" and I am wondering why what I have will not work, I have purposefully placed a corrupted zip file into a folder containing several zip files and the wzunzip output says the word "Error" in the 2nd line, but when I try the following it just shows the output of running wzunzip and not the following part that should confirm the word "Error" is in the output.


Code
use warnings; 
use strict;

$_ = print `wzunzip -o c:\\begperl\\zips\\*.zip`;
if ($_ =~ /Error/) {
print "found the word 'error'\n";
}


Here is a sample of the wzunzip output, after playing with it for a while i think this is happening because it doesn't read past the empty lines, i think it's only reading "Zip file: c:\begperl\zips\1.zip" and then stops.


Code
Zip file: c:\begperl\zips\1.zip 

Error [c:\begperl\zips\1.zip]: unrecoverable zip file read error

Zip file: c:\begperl\zips\792112CL.ZIP

unzipping 792112CL.LBL

Zip file: c:\begperl\zips\792113CL.ZIP

unzipping 792113CL.LBL

Zip file: c:\begperl\zips\793489CF.ZIP

unzipping 793489CF.LBL

Zip file: c:\begperl\zips\793609CF054.ZIP



(This post was edited by 200mg on May 26, 2009, 8:34 AM)


Edit Log:
Post edited by 200mg (New User) on May 26, 2009, 8:32 AM
Post edited by 200mg (New User) on May 26, 2009, 8:34 AM


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

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