in reply to Re: subprocess delay on Windows with Perl/Tk
in thread subprocess delay on Windows with Perl/Tk

Thanks. Win32::Process works, but I'd have to know the full path to excel.exe. "start" lets the file type registry on the client pc take care of finding excel ("start" also takes care of forking and returns immediatly, the Tk program doesn't have to wait for excel to exit, although in this case *everthing* is waiting for excel to *start*).

Backticks with `start file.csv` work fine as long as the Tk event loop isn't running. I'd still like to hear if anyone else has the same problem.

  • Comment on Re^2: subprocess delay on Windows with Perl/Tk

Replies are listed 'Best First'.
Re^3: subprocess delay on Windows with Perl/Tk
by pfaut (Priest) on Jun 03, 2004 at 19:15 UTC
    Win32::Process works, but I'd have to know the full path to excel.exe.

    That's not hard to find.

    use File::Spec; sub find_in_path { my $prog = shift; my $fmm; for my $d (File::Spec->path()) { $fnm = File::Spec->catfile($d,$prog); last if -x fnm; $fnm = undef; } return $fnm; } my $excel = find_in_path('excel.exe');
    90% of every Perl application is already written.
    dragonchild
      Thanks, but that's assuming excel.exe is in your path. It's typically not, rather it's typically in some place like c:\Program Files\Microsoft Office\Office10\. That's the case with most Windows packages that you'd install.

        I'm confused. You complain you can't use one method because it requires a full path. Then you say it may not be in your path. How do you invoke it then? Either you need to know where it is and provide the full path or it needs to be in your path. Am I missing something?

        90% of every Perl application is already written.
        dragonchild
Re^3: subprocess delay on Windows with Perl/Tk
by PodMaster (Abbot) on Jun 03, 2004 at 19:51 UTC
    If that's a problem for you, then use system or fork/exec.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.