The big problem I would have with something like that, is that it requires you to remember (and type every time you want to use it) which arguments you need to provide to tail. You can do the same thing in perl fairly easily using something like File::Tail, File::Tail::App, or just plain seek.
For example, I would guess your readStdin.pl looks something like this:
while( my $line = <STDIN> ) { # do some stuff with $line }
Using File::Tail::App, you can very easily build the tail part into your application, like so:
use File::Tail::App; tail_app({ new => shift, line_handler => sub { my ( $line ) = @_; # do some stuff with $line }, });
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Using pipe and reading from the stdin
by jasonk
in thread Using pipe and reading from the stdin
by mellin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |