in reply to Copying a directory recursively

I am assuming that when you say "pure perl" you mean without having to use a Perl module. In that case why not case off of the $^O (OS) variable ... you know ... something like this ...
sub setRecursiveCopyCommand { my $OS = $^O; if ( $OS eq 'VMS' ) { return whatever the hell they do in VMS } elsif ( $OS eq 'PLAN9' ) { return whatever the hell they do in PLAN9 } elsif ( $OS eq monkeys_fly_out_of_my_ass ) { you get the picture } else { ... }
Note above code is untested. And may require some effort on your part ... :P

Plankton: 1% Evil, 99% Hot Gas.

Replies are listed 'Best First'.
Re: Re: Copying a directory recursively
by BUU (Prior) on Mar 10, 2004 at 06:36 UTC
    Because trying to shell out to xcopy wasn't working =/. Actually by "pure perl" I meant not utilizing any other binary.

      Note that by default DOS's xcopy does not copy recursively, you have to give a switch to do that, /E I think.

        /s for recursive (s for sub directories).
        /e to copy empty subdirectories.
        /o might be of interest too. Use it to also copy file ownership and ACL information.