home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / EDITOR / NVI179B / NVI179B.ZIP / perl_scripts / make.pl < prev    next >
Text File  |  1996-08-13  |  564b  |  28 lines

  1. sub make {
  2.     open MAKE, "make 2>&1 1>/dev/null |";
  3.     while(<MAKE>) {
  4.     if (($file, $line, $msg) = /([^: ]*):(\d*):(.+)/) {
  5.         if ($file == $prevfile && $line == $prevline) {
  6.         $error[-1]->[2] .= "\n$msg";
  7.         } else {
  8.         push @error, [$file, $line, $msg];
  9.         ($prevline, $prevfile) = ($line, $file);
  10.         }
  11.     }
  12.     }
  13.     close MAKE;
  14. }
  15.  
  16. sub nexterror {
  17.     if ($index <= $#error) {
  18.         my $error = $error[$index++];
  19.         $curscr->Edit($error->[0]);
  20.     $curscr->SetCursor($error->[1],0);
  21.     $curscr->Msg($error->[2]);
  22.     }
  23. }
  24.  
  25. # preverror is left as an exercise
  26.  
  27. 1;
  28.