c has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use File::Copy; my $from = "/root/yim"; my $to = "/root/perl/yim"; if ( -d $from ) { mkdir "$to"; } opendir(DIR,"$from"); my @contents = readdir(DIR); for my $i(@contents) { if ( -f "$from/$i" ) { copy("$from/$i","$to/$i"); } } close(DIR); print @contents;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Misinterpretation of File::Copy
by lemming (Priest) on Jul 23, 2001 at 14:28 UTC | |
|
Re: Misinterpretation of File::Copy
by wine (Scribe) on Jul 23, 2001 at 14:34 UTC | |
|
Re: Misinterpretation of File::Copy
by PetaMem (Priest) on Jul 23, 2001 at 14:43 UTC | |
by c (Hermit) on Jul 23, 2001 at 15:04 UTC | |
|
Re: Misinterpretation of File::Copy
by grinder (Bishop) on Jul 23, 2001 at 17:46 UTC |