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