http://qs321.pair.com?node_id=63098
Category: Win32 Stuff
Author/Contact Info Dave McKee, dmckee, anti@anti.co.uk
Description: Parses C:\bootlog.txt on Windows 98 machines to extract 'important' lines - ie: the ones where it's all gone wrong. Dead simple
#!/usr/bin/perl -w
use strict;
my ($readline,$found);
my @aok=("Loading Vxd =",             # A list of all the different va
+lues
      "LoadSuccess =",                # that should be ignored. Others
+ are
      "Loading Device =",             # left in for debugging purposes
+.
      "LoadSuccess    =",
      "SYSCRITINIT  =",
      "SYSCRITINITSUCCESS  =",
      "DEVICEINIT   =",
      "DEVICEINITSUCCESS   =",
      "Dynamic init device ",
      "Dynamic init success",
      "Dynamic load device ",
      "Dynamic load success",
      "Initing",
      "Init Success",
      "INITCOMPLETE =",
      "INITCOMPLETESUCCESS =",
      "LoadStart =",
      "Init =",
      "InitDone =",
      "Status =");
open BOOTLOG, "<C:\\bootlog.txt" or die ("Error: could not open c:\\bo
+otlog.txt\n$!\n"); # Open up the file
while (not eof(BOOTLOG)) {
  $readline=<BOOTLOG>;
  $found=0;
  foreach (@aok) {if ($readline =~ m/.*$_.*/) {$found=1}}; # Check aga
+inst each @aok to see if it's valid: if it is, $found.
  chomp($readline);                                        # If not, t
+hen print it out if it's not just a newline.
  unless ($found) {if ($readline) {print "$readline\n";}};
}