in reply to Re: How to give an EOF from windows Standard input?
in thread How to give an EOF from windows Standard input?

hey i got the issue i was giving Ctrl+Z then followed by some other commands. may be that caused the problem..now it works fine .. Also when i tried to run the perl script not from the command prompt directly from the perl for ex: the code #!/usr/local/bin/perl -w @lines= <STDIN>; print "@lines"; print"This is new \n"; i saved it as input.pl and when i clicked on that from the folder the prompt window was shown i was able to give the inputs and when i pressed Ctrl+Z the window was closed without showing the "This is new" text. How can i make my prompt window stay.
  • Comment on Re^2: How to give an EOF from windows Standard input?

Replies are listed 'Best First'.
Re^3: How to give an EOF from windows Standard input?
by BrowserUk (Patriarch) on Feb 11, 2011 at 17:03 UTC

    Please use <code></code> tags around code in your posts.

    The console window will close as soon as the script ends. If you want the window to stay a round for a few seconds, add a sleep before it terminates:

    #!/usr/local/bin/perl -w @lines= <STDIN>; print "@lines"; print"This is new \n"; sleep 60;

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: How to give an EOF from windows Standard input?
by cdarke (Prior) on Feb 11, 2011 at 17:58 UTC
    Depends whether you want the console window, which is what is generated for perl, or a cmd.exe shell. If it is a cmd.exe shell you want then run your perl script from a short-cut or association with:
    %comspec% /k perl c:\gash.pl
    where c:\gash.pl is the path to the script. It will run the script then give you a prompt.