Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Simple first pass at it: using qr//:

    @f ileext=("\\.gif","\\.jpg","\\.css","\\.GIF","\\.JPG","\\.CSS");
    $filename="$ARG V[0]";
    open(IN,$filename) || die "cannot open $ARGV[0] for reading: $!";
    open(OUT,">$filename.out") || die "cannot open $filename.out for writing: $!";

    # compile once
    $fileext = join '|', @fileext;
    $fileext = qr/(?:$fileext) HTTP/;
    $sunIPs = join '|', @sunIPs;
    $sunIPs = qr/^(?:$sunIPs)/;

    LINE: while(<IN>) {
         next LINE if /$filext/;
         next LINE if /$sunIPs/;
         print OUT;

    This remains untested, but I'd bet that's faster!