##
my $ls = $sftp->ls('/home/foo')
or die "unable to retrieve directory: ".$sftp->error;
print "$_->{filename}\n" for (@$ls);
####
$pat4 = $envment . "REQ_*.req.copied";
...
$ls4 = $sftp->ls('/', names_only => 1, wanted=>qr/$pat4/);