in reply to Re^4: Get contents in an FTP path using glob
in thread Get contents in an FTP path using glob

I suggest getting all the files once, and then grep'ing that list twice for your @cat1 and @cat2. I'm not completely sure what you're trying to match, but something like this?

my @files = $ftp->ls(); my @cat1 = grep { /h+_/ } @files; my @cat2 = grep { /-zips/ } @files;