rkg has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use FileHandle; sub slurp { my $fh = new FileHandle; my $file = 'STDIN'; $file = $_[0] if $_[0]; $fh->open($file) or die "Can't open $file: $!"; $fh->input_record_separator(undef); my $slurp = <$fh>; $fh->close or die "Can't close $file: $!"; $slurp; } print slurp();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: STDIN question
by castaway (Parson) on Jun 19, 2003 at 14:13 UTC | |
by rkg (Hermit) on Jun 19, 2003 at 14:43 UTC | |
by Tomte (Priest) on Jun 19, 2003 at 15:37 UTC | |
|
Re: STDIN question
by hmerrill (Friar) on Jun 19, 2003 at 14:19 UTC | |
|
Re: STDIN question
by ant9000 (Monk) on Jun 19, 2003 at 15:19 UTC | |
|
Re: STDIN question
by mod_alex (Beadle) on Jun 19, 2003 at 15:43 UTC |