Skip to content

Instantly share code, notes, and snippets.

@orimanabu
Created December 4, 2010 21:33
Show Gist options
  • Save orimanabu/728496 to your computer and use it in GitHub Desktop.
Save orimanabu/728496 to your computer and use it in GitHub Desktop.
"tail -f" in perl
#!/usr/local/bin/perl
use strict;
use warnings;
open FILE, $ARGV[0] or die;
my $curpos;
for (;;) {
for ($curpos = tell(FILE); $_ = <FILE>; $curpos = tell(FILE)) {
print;
}
sleep 1;
seek(FILE, $curpos, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment