in reply to Ftype/Associate

I'm not sure what you mean by implement these in Perl. Do you want to do something like this:
assoc('.pl', 'd:\perl\bin\perl.exe'); # so you can run programs like this: run_cmd('c:\stuff\script.pl');
If this is what you're looking for, you could make a hash of known file extensions. Your functions could look like this (untested):
use vars qw/%extensions/; # keep known extensions here. %extensions = (); sub assoc { my ($extension, $prog) = @_; $extensions{$extension} = $prog; } sub run_cmd { my $cmd = shift; my $ext = ""; if ($cmd =~ /(\.\w+)$/) { $ext = $1; } # prepend interpreter for known extension if ($ext and exists $extensions{$ext}) { $cmd = "$extensions{$ext} $cmd"; } return `$cmd`; }

This loose code won't support arguments like myscript.pl --args, but that can be left as an exercise in string parsing.

I hope this is what you were asking!

Update: John M. Dlugosz's response above is probably more what you're looking for, upon reinspection of your question.