http://www.perlmonks.org?node_id=624845


in reply to the greedy diamond, or leggo my STDIN

or transfer the stream to arguments...
$ ls | xargs sillytest
#!/usr/bin/perl my @msg = join "\n", @ARGV; # continue normally - STDIN was not redirected by xargs
update: and if on a non-*nix platform, you can roll your own xargs easily enough:
#!/usr/bin/perl # XARGS.EXE v0.1 shift @ARGV; push @ARGV, <STDIN>; chomp @ARGV; exec join( ' '. @ARGV;
__________________________________________________________________________________

^M Free your mind!