In perl.beginners Mel Awaisi <[EMAIL PROTECTED]> wrote:
> 
> the part in the script that the error i think is arising 
> from is
> 
> my $dir = '/home/me/images/';
> my @jpegs = `ls *.jpg`;
> foreach (@jpegs) {
>       print"$_";      # dont forget that a newline is 
>                       # still at the end of each 
>                       # element in the array...
> }
> 
> ------------------------
> ls: *.jpg: No such file or directory
> -----------------------

I'm not sure what your question is... but since you've
declared $dir and not actually used it, maybe you want
to try one of these:

  #
  # add the directory to the glob
  #
  my @jpegs = qx{ ls $dir/*.jpg };

  #
  # or better yet, use Perl's glob
  #
  my @jpegs = glob "$dir/*.jpg";

You could also chdir() to the images directory first.

[ f'ups set ]

HTH
-- 
Steve

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

Reply via email to