in reply to Proc::Background (or runing something seperate)

If there are no spaces in the path name and the file's permissions are set to allow execute access you can do this:
system("start $filename");

But the better way to do it is to install Win32::API via the PPM command (or CPAN); then you can do this:

use Win32 qw(SW_SHOWNORMAL); use Win32::API; use strict; my $FILE_OR_URL = ... whatever ...; my $shellexec = Win32::API->new('shell32', 'ShellExecute', 'NPPPPI', 'N') or die "cannot import ShellExecute: $!\n"; my $result = $shellexec->Call(0, "open", $FILE_OR_URL, "", ".", SW_SHOWNORMAL); if ($result < 33) { print STDERR Win32::FormatMessage($result), "\n"; exit(1); }

Replies are listed 'Best First'.
Re^2: Proc::Background (or runing something seperate)
by Ace128 (Hermit) on Sep 06, 2005 at 12:11 UTC
    Thanks, but I was hoping for a more multios solution... But I guess this will do... :)
Re^2: Proc::Background (or runing something seperate)
by Ace128 (Hermit) on Sep 06, 2005 at 12:12 UTC
    Btw, wanna explain some of the code there? NPPPPI?