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

windiff.exe is a diff program that comes with Visual Studio. I'm seeing that when I start windiff via the system function in perl, that the windiff process starts, but the main window fails to open. Consider this short script called wd.pl:
---------------------------------------- $cmd = "windiff @ARGV"; print "$cmd\n"; system("$cmd"); ----------------------------------------
Here's what I see:
> windiff.exe :brings up empty windiff window > wd.pl :starts windiff process, but no window > windiff.exe -? :brings up empty windiff window with a help dialog box > wd.pl -? :brings up only the empty dialog box.
Any clues?

2002-10-31 Edit by Corion : Added CODE tags

Replies are listed 'Best First'.
Re: system'ing a gui app
by grep (Monsignor) on Oct 31, 2002 at 20:56 UTC
    My suggestion would be - go with a real windows command line diff utility. Cygwin has one along with Perl Power Tools.

    You also want to use code tags to wrap any code in, and look at the preview of your post before you submit it (so you can catch mistakes before they happen)



    grep
    Mynd you, mønk bites Kan be pretti nasti...
Re: system'ing a gui app
by Thelonius (Priest) on Oct 31, 2002 at 21:41 UTC
    Your code works fine when I run it on Win2K. Which OS are you using? One thing you could try is
    system("start $cmd");
      I'm using Win2K. Adding the 'start' seems to work.
      Did it work on your machine without the 'start' ???
      What does 'start' actually do? I've never seen that before.
        The Windows' "start" command is simply a launcher that can be used from a command prompt to start windowed programs in various ways. You can also use "start" on registered file types directly (ie, "start MyPaper.doc") and it will act like you double-clicked on that file in an Explorer view. It's pretty nifty sometimes.

        kelan


        Perl6 Grammar Student

Re: system'ing a gui app
by Mr. Muskrat (Canon) on Oct 31, 2002 at 21:54 UTC

    Well, I tried it on Win98 and it works as expected. Based on your usage (no perl, just the program name), I'd say you are running Windows NT, 2k or XP.

    Perhaps the OS is not passing the -? to the perl program... When you run wd.pl -?, what does it print for $cmd?

    update: switched order of last question around to improve readability.

      I'm using Win2K. The output is exactly what I was typing directly on the command line: windiff -?