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 { ... }