in reply to Use of special character "*" to retrieve the contents
Here's another way to do it, using Path::Class, which can also do the copying for you:
use Path::Class qw/file dir/; for my $file ( dir($var1,$var2,$var3)->children ) { next if $file->is_dir || $file->basename !~ /.+\.ksh$/; $file->copy_to($target) or die "Failed to copy $file to $target"; }
Note this will copy filenames beginning with a dot as well.
|
|---|