$ cat foo.pl #!/usr/bin/perl use strict; use warnings; my $file=shift; open my $fh, $file or die $!; print "The contents of `$file' are:\n", <$fh>; __END__ $ ./foo.pl aaa The contents of `aaa' are: asdfdaf sfdfdd sffgsdd $ ./foo.pl '|echo "Gotcha!">foo.pl' The contents of `|echo "Gotcha!">foo.pl' are: $ cat foo.pl Gotcha!