#! /usr/bin/perl # Does something to Ogame combat reports... Don't really care anymore use strict; my $input; open (CREPORT, $input = "index.php.html") || die ("Could not open file: $!"); # print ("File opened\n"); open (CROUT, ">tmp"); #local $/; my $atacker; my $defender; my $day; my $month; while () { # Getting atacker and defender names if (/>(.*)\ vs.\ (.*)/[x:xxx:xx]<\/a>/; if (/[ \t\n]*Weapons.*Armour.*<\/tr>/m) { print STDERR ("yep\n"); } print CROUT; } close(CREPORT); close(CROUT); my $output = "$month.$day $atacker -vs- $defender.html"; rename ("tmp", "$output") || die ("Could not create file $output"); unlink ($input); print ("$input renamed as $output\n");