in reply to Search Directory

Read up on File::Find -- it will probably be the most portable and bug-free way to go; and, it just might be the most efficient to code (depending).

If your issue is that you only want to find the first file and then stop, try using

foreach (@files) { next unless ($_ eq $img_name); ## skip ones we don't want print "$_\n"; last; } ## or, if you want all files up to (and including) that name: foreach (@file) { print "$_\n"; last if ($_ eq $img_name); }

I suggest (re-)reading the "Control Structures" part of the Camel book for more.

radiantmatrix
require General::Disclaimer;
s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}