If you had used Data::Dumper to look at @dir_files like I suggested, you'd see strings such as "-rw-rw---- 1 xupromgr xupromgr 10 Feb 27 14:08 auditsample.txt", which won't match the regex /^audit/. Try using the command $ftp->ls instead of $ftp->dir to list files, this should give you a listing consisting of file names only.
You should always Use strict and warnings, and see also the Basic debugging checklist.
In reply to Re^3: Perl Regex \A or ^ Not Working
by haukex
in thread Perl Regex \A or ^ Not Working
by thundercat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |