in reply to STDIN question

Hello First, please, read about file handling in perl and
think after what $file='STDIN' means.
check this version of your method
#! /usr/bin/perl use strict; use warnings; use strict; use FileHandle; sub slurp { my $fh = new FileHandle; my $file = shift; local undef($/); if (defined($file)) { $fh->open($file) or die "Can't open $file: $!"; } else { $fh->fdopen(*STDIN, 'r'); } my $slurp = <$fh>; $fh->close or die "Can't close $file: $!"; $slurp; } print slurp();
Alex