--- Evan McNabb <[EMAIL PROTECTED]> wrote:
> I've been working on a little script for a while but I can't seem to
> get this part working. What I want to do is list all of the *.jpg
> files in a directory (ls *.jpg) and then have an array with each
> filename as elements of that array. Its probably easy but I just
> can't get it right yet... :-) 

Quick and (a little) dirty:
  my @jpg = <*.jpg>;

Explicit:
  opendir DIR, "." or die $!;
  my @jpg = grep { /[.]jpg$/i } readdir DIR;
  close DIR;

This has the advantage of also working on *.JPG files.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to