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

I am running a Perl script on a Win XP pc. I am running with ActivePerl. When I run my script at the cmd prompt, I have to hit the enter key twice in order for the script to complete. I'd like to just have the script run with no intervention. Anyone know what I can do to get this done?

Replies are listed 'Best First'.
Re: Running Perl Script on Win32
by tachyon (Chancellor) on Oct 02, 2003 at 04:12 UTC

    Does this script take 2 enters to complete?

    #!/usr/bin/perl print "Hello XP World\n";

    If not I suggest posting the problem code.....

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Running Perl Script on Win32
by Roger (Parson) on Oct 02, 2003 at 07:19 UTC
    You need to give a bit more information on your problem. Posting a *snip* of your code would be more useful. Otherwise we can only *GUESS* what's going wrong in your script.

Re: Running Perl Script on Win32
by NetWallah (Canon) on Oct 02, 2003 at 06:03 UTC
    1. Check your PATH looking for files named "perl.bat" or "perl.cmd". These may be running perl behind your back, and requiring an <ENTER> before they quit.

    2. check your script for code similar to

    <STDIN>;
    Which asks for keyboard input before it can proceed.
Re: Running Perl Script on Win32
by sbdesalvo (Initiate) on Oct 03, 2003 at 00:18 UTC
    I figured out the problem. I stole some code from a Unix Perl script that I wrote at work. In this code I capture the date via:  $DATE=`date`;. This works without fault in Unix, but in W32 cmd.exe, the date command expects a response unless the /T switch is used. Thanks to each who replied.