I am using Activeperl version Perl v5.10.1 I have a zip file called c:\perl\data\my.zip containing one file called file1.txt which is an ascii file. I would like to use the Uncompress::Unzip utility or anything else to merely read file1.txt file and count the number of occurances of a string 'X.X' in it. If I were reading a simple ascii file instead of a zip file my program will look as follows.
$LOGFILE = 'c:\perl\data\file1.txt'; open(LOGFILE) or die("Could not open log file."); $mycount = 0; foreach $line (<LOGFILE>) { chomp($line); if ($line eq 'x.x'){ $mycount++; } } print "Found a total of $mycount occurances of x.x!\n"; close(LOGFILE);
In reply to Reading zip files by Dell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |