in reply to the greedy diamond, or leggo my STDIN
#!/usr/bin/perl die("usage: sillytest file [file [file [...]]]\n") if not @ARGV; my @msg = <>; chomp(@msg); print(join("\n", @msg)); print "What do you want to do with this message?"; my $response = <STDIN>; print $response;
To pass the output of ls, you'd do
sillytest `ls`
or just
sillytest *
By the way, you might be interested in
my $msg = do { local $/; <> }; print($msg);
|
|---|