in reply to Globbing and Moving Together

this works for me...
#!/usr/bin/perl -w use strict; use File::Basename; use File::Copy; my @sourceD = "i:/tmp"; my @targetD = "c:/temp"; move @{$_} foreach map { [ "$sourceD/$_", "$targetD/$_" ] } map {basen +ame $_} <$sourceD/*.pl>;
i can break it down a bit...
the important statement, obviously, is the last. map statements are best read backwards. so let's do that.

~the end <$sourceD/*.pl> is the glob. this creates a list of files.
~the first map (working backwards) map {basename $_} gets the basename of the files, in a list
~the second map map { [ "$sourceD/$_", "$targetD/$_" ] } creates a list of anonymous arrays with the source path/filename, and target path/filename
~the foreach lets us iterate over each member in the list of anonymous arrays
~the funny looking @{$_} takes the anonymous array reference in $_ and evaluates it as an array, which is fed to move.

err... i didn't check the output of move, either...

~Particle