Thanks
On 8 Feb 2013 07:37, "shawn wilson" <ag4ve...@gmail.com> wrote:
>
> How do I take in a file or pipe input?

Please check this

http://perldoc.perl.org/functions/open.html

What I want is:
> script.pl file.txt
> or
> cat file.txt | script.pl
>
> What I'm trying is:
> my $logfile;
> if (@ARGV and $ARGV[0] =~ /^-./) {
>   open($logfile, '<', $ARGV[0]);
> } elsif (-t STDIN and not @ARGV) {
>   $logfile = <STDIN>;
> } else {
>   doe "no data"
> }
>
> PS - I want to avoid slurping the whole file.
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>

Reply via email to