gj2666 has asked for the wisdom of the Perl Monks concerning the following question:

I have a command: `"c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE" $outdoc`; It routinely hangs when the user while viewing the $outdoc in IE selects "Print" from the file menu. It's as if IE is still waiting for the print command to come back from the great beyond. Any suggestions would be greatly appreciated. I did also try: system("c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE" $outdoc); It doesn't display at all. It just flashes the cmd box. There was a reference to "try start" on one of the postings I found with supersearch but the syntax wasn't given and I couldn't find a reference to "start" in the camel books. I also fiddled with  exec`"c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE" $outdoc`; but that hangs as well and if I try exec(...) the interpreter barfs on the compile.

Replies are listed 'Best First'.
Re: System hangs question xp
by zer (Deacon) on Mar 30, 2006 at 21:36 UTC
    it works for me.. The only change i made was to add a colon next to the $outdoc

    #!/usr/bin/perl -w use strict; use warnings; my $outdoc ="www.google.ca"; system("c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE", $outdoc);
      It comes up fine but when you use the print function to print the page that's where I hang. I've been working with this syntax this morning and it looks promising but for the damn spaces in the file names that someone (IE probably) keeps changing the spaces to %20.
      `start "format cr to print" /SEPARATE "c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE" "$outdoc2"`;
      where the variable $outdoc2 = "C:\Documents and Settings\username\Local Settings\Temporary Internet Files\cr.html"
      IE ends up trying to access: http://"c:/Documents%20and%20Settings/username/Local%20Settings/Temporary%20Internet%20Files/cr.html".
      Any tips on fooling IE?
        This works for me:
        my $docname = 'C:\Dokumente und Einstellungen\Administrator\Desktop\cr +.html'; system 'start "test 1 2 3" iexplore '.$docname; print "I returned immediately, doesn't matter if the user wants to pri +nt the file from IE\n";
Re: System hangs question xp
by holli (Abbot) on Mar 30, 2006 at 21:53 UTC
    I couldn't find a reference to "start" in the camel books.
    That's probably because start has nothing to do with perl. It is a system command. Try typing start /? at the command line.


    holli, /regexed monk/