for ($data){ if (m#/([^/]*\.bld)$#) { $count=$count+1; $hold[$count]=$1; print "$hold[$count]\n"; } }