#!/usr/bin/perl print < IRC Log EOF while (<>) { chomp; s{^\[(\d+-\d+-\d+) (\d+:\d+:\d+)\] }{}; $date = $1; $time = $2; if ($date ne $curdate) { print "\n"; $curdate = $date; } if (s{^<([^:]+):([^>]+)> }{}) { $nick = $1; $channel = $2; $outnick = "<$nick>"; } elsif (s{^\* ([^/]+)/([^ ]+) }{}) { $nick = $1; $channel = $2; $outnick = "* $nick"; } if ($channel ne $curchan) { print "\n"; $curchan = $channel; } s{&}{&}g; s{<}{<}g; s{>}{>}g; s{([^]*)}{$1}g; s{([^]*)}{$1}g; if ($outnick) { s{^}{$outnick}; print "$_\n"; } print < EOF
$date
$channel
}; } s{^}{
$time }; s{$}{