in reply to Need help with Piping

You have some solutions for getting STDIN, but do you really need separate scripts? Why not let a.pl run 'ls' or your command? Trying to force things thru STDIN is often frought with difficulty and should be avoided if possible, unless you need to build a chain of commands for some reason.

Just use a piped open, or read perldoc perlipc for the many other ways to do it.

#!/usr/bin/perl open (LS,"ls |" ) or die $!; my @files = (); while(<LS>){ chomp; push @files, $_; } print "@files\n";

I'm not really a human, but I play one on earth Remember How Lucky You Are