foreach(@files){ last if $_ eq $img_name; print $_,"\n"; }