On Dec 10, 2003, at 2:11 AM, Ben Crane wrote:
Drieux,
I'm not passing the filehandle, I want to pass a variable that contains the file path...I'm getting the path from a text file, but that text file doesn't contain extensions and each file has multiple extensions. So I need to copy all files with the same name but different extensions.
call me old and slow, but I would do something like:
[jeeves: 21:] perl -MFile::Copy -e 'my $filename='junk' ; my @list = <$filename.*>; File::Copy::copy($_ , 'Target') foreach(@list);'
[jeeves: 22:] ls -lR Target
total 48
-rw-r--r-- 1 drieux house 251 10 Dec 07:44 junk.cgi
-rw-r--r-- 1 drieux house 88 10 Dec 07:44 junk.file
-rw-r--r-- 1 drieux house 841 10 Dec 07:44 junk.html
-rw-r--r-- 1 drieux house 81 10 Dec 07:44 junk.plx
-rw-r--r-- 1 drieux house 97 10 Dec 07:44 junk.rb
-rw-r--r-- 1 drieux house 443 10 Dec 07:44 junk.sh
[jeeves: 23:]
or in the more traditional format
my $filename = ....your_method_here.... my $target = ...how_do_you_know_this....
my @list = <$filename.*>; File::Copy::copy($_ , $target) foreach(@list);'
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>