in reply to system() or exec() in CGI scripts

fork and exec, despite the heroic efforts of a number of people, don't really work on Win32 platforms. You're much better off using Perl's Win32 interface. Something like the following will get you on your way:

use Win32; use Win32::Process; my $ie; Win32::Process::Create( $ie, 'C:/Program Files/Internet Explorer/iexplore.exe', 'http://localhost/foo.html', 0, NORMAL_PRIORITY_CLASS, '.' ) or print Win32::GetLastError();

Needless to say, this won't run on Unix, but if you are careful you can encapsulate this, and do the Right Thing according to platform.

Replies are listed 'Best First'.
Re: Re: system() or exec() in CGI scripts (use Win32)
by LupoX (Pilgrim) on Sep 09, 2003 at 12:12 UTC

    Thank you this works perfectly! I spuriously trusted the built in function more than any module.
    In German I would say: "Aus Fehlern wird man klug, drum ist einer nicht genug" (What meens something like "From errors you get smart so one ist not enough")

Re: Re: system() or exec() in CGI scripts (use Win32)
by BrowserUk (Patriarch) on Sep 09, 2003 at 12:21 UTC

    They work fine for me? Care to elusidate?


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.