klebercarvalho

seek.pl

Feb 4th, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.70 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. $FILE = "test.file";
  4. #$FILE = "SystemOut.log";
  5. #$filehandler = LOGFILE;
  6. $filehandler = INFILE;
  7. open ($filehandler, "$FILE") || die "Not able to open the file: $FILE \n";
  8.  
  9. while (1) {
  10.  
  11.         $skip = tell($filehandler);
  12.         print "Starting with : $skip \n";
  13.         $line = <$filehandler>;
  14.         print "$line";
  15.        
  16.         seek($filehandler, 0, 2);
  17.         $curreof = tell($filehandler);
  18.         print("curreof=" . $curreof . "\n");
  19.         $line = <$filehandler>;
  20.         print "$line";
  21.        
  22.         #seek(LOGFILE,-80,1);
  23.         #$line = <LOGFILE>;
  24.         #print "$line";
  25.         print "\n ---------------------------------------- \n";
  26.  
  27.         last;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment