Processing gzipped files with Perl IO:Uncompress 7
Idiom of the day:
use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
foreach $host ( "foo", "bar", "dev", "teset") {
foreach $site ( "public", "private" ) {
foreach $date ( "20071223", "20071224", "20071225", "20071226", "20071227", "20071228", "20071229", "20071230", "20071231", "20080101" ) {
$input="/web/$host/$site/logs/access-$date.gz";
next unless -f $input;
my $z = new IO::Uncompress::Gunzip $input or die "IO::Uncompress::Gunzip failed: $GunzipError\n";
while (<$z>) {
next unless / 200 /;
@F=split;
($URI, $therest) = split(/\?/, $F[6], 2);
# perl regex operation on the URI
}
}
}
}
Comments
-
no kidding,this is a very good blog post,i like the idea how you organize your points of view by authority then you speak about each individually,very smart of you,consider having a new blog reader
-
it needs a bokmark so i can come back to it later ,nice stuff
-
hmm ,i'm not sure if this is what i'm looking for but anyway this is interresting and could be useful some day,thanks for taking time to write such cool stuff
-
Hmm,i see that you made your points,you are really a cool author.
-
When I at first left a comment I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get three notification emails with the same comment. Is there any way you can take away people from that service? Thanks a lot!
-
Stuff like these desurves a twit and maybe a bookmark,your content is very good and i thank you for that
-
Man where is your RSS feed,don't want to loose this blog ,may help me in my online studies,loads of great stuff