This has been a well discussed topic, but here is a short snippet to copy a file from a known directory to another:
use strict; use File::Copy; use File::Spec; my $source_directory = 'foo'; my $target_directory = 'bar'; sub copyfile { for my $file (@_) { my $sourcename = File::Spec->catfile( $source_directory,$file); my $targetname = File::Spec->catfile( $target_directory,$file); copy( $sourcename,$targetname) or warn "Couldn't copy $sourcename to $targetname : $!"; }; }; copyfile('README');
In reply to Re: copy to different directory
by Corion
in thread copy to different directory
by wolverina
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |