James Hughes wrote:

> 
> Just a thought, but try to change to your directory first........
> 
> my $dir = '/home/me/images/';
> my @jpegs = `ls *.jpg`;
> chdir ($dir) || die "Cannot chdir to $dir: $!";;
> foreach (@jpegs) {
> print"$_";    # dont forget that a newline is still at the end of
> each element in the array...
> }

err, make that

my $dir = '/home/me/images';
chdir $dir or die "Cannot chdir to $dir: $!";
my @jpegs = glob "*.jpg"; #use perl rather than shell wherever possible

print join("\n", @jpegs) if scalar(@jpegs);

Always chdir to the dir you need FIRST, before actually trying to get a list 
of files IN it. ;) 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to