#!/usr/bin/perl -w use strict; $|=1; my $logfile = shift; my $outfile = shift; my $ip = shift; my $url = shift; open (LOG, $logfile) or die "Error opening $logfile: $!"; open (OUT, "> ".$outfile) or die "Error opening $outfile: $!"; print "Beginning conversion\n"; while () { next unless /^$ip/; /GET\s+$url(\S+)\s+/; my $hexstr = $1; next unless defined($hexstr) && $hexstr ne ''; chomp($hexstr); $hexstr =~ s/%(..)/pack("c",hex($1))/ge; print OUT $hexstr; print '.'; } print "\nDone\n"; close(OUT); close(LOG);