asdfghjkl has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use File::Copy; $dest="target"; print "source:\n"; chomp(my $source=<STDIN>); opendir(DIR, $source) or die "cannot open the directory '$source': $!"; @files = grep { /\.log$/ } readdir (DIR); foreach $file(@files){ copy "$source/$file", "$dest$file" or die "can't copy file $file: $!"; } closedir (DIR);
20071110 Edited by Co-Rion: Restored content
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to Modify Each file??
by shmem (Chancellor) on Oct 20, 2007 at 23:43 UTC | |
|
Re: How to Modify Each file??
by chromatic (Archbishop) on Oct 20, 2007 at 21:02 UTC | |
by Anonymous Monk on Oct 20, 2007 at 21:19 UTC | |
by downer (Monk) on Oct 21, 2007 at 04:39 UTC | |
| |
|
Re: How to Modify Each file??
by GrandFather (Saint) on Oct 20, 2007 at 21:49 UTC | |
by shmem (Chancellor) on Oct 20, 2007 at 22:55 UTC |