why -l? He only wants the file names, right? And why are you assuming that AM is executing the "ls -l" in his script? Maybe he is reading in a old log file or something else.
update
-l as in "ls -l" not 1 as in 1 2 3. My point being if AM is executing "ls -l" and dealing with the output of "ls -l" it would be simplier to execute "ls" with no options. The output of that is simplier to deal with and AM could avoid using split all together.
update again
open(LS, 'ls|') or die "Cannot open 'ls' for reading\n";
while (<LS>)
{
chomp; #Added after some thought.
print "$_\n";
}
close LS;
| You can't do this to me! I went to college! |