Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Waiting For Input

by Anonymous Monk
on Mar 04, 2013 at 08:11 UTC ( #1021596=note: print w/ replies, xml ) Need Help??

in reply to Waiting For Input script runs and completes execution and then keeps on waiting ie does not end. Why?

Because it is written that way. Maybe its waiting for input, like pause, or something else entirely, depends on what does

The cmd cursor keeps blinking even after the script is run

cursors are designed to blink, its what they do

Comment on Re: Waiting For Input
Replies are listed 'Best First'.
Re^2: Waiting For Input
by Anonymous Monk on Mar 04, 2013 at 08:20 UTC

    No does not need any input nor any pause. Rather the main scipt conatins this:

    use Win32::Process; use Win32; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Create($ProcessObj, "C:\\Perl\\bin\\perl.exe", "perl", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); $state = 1; while( <STDIN> ) { if( $state ) { $$ProcessObj->Suspend(); $state = 0; } else { $$ProcessObj->Resume(); $state = 1; } }

    How do i end both the scripts? i think it is the main script that keeps on waiting..

      So, when does the loop end?

      while( <STDIN> ) { ... }

      Maybe you want to print out some diagnostics at the end of and in your main script, to learn when a program starts or finishes, and when a program waits for input.

        The script gives me the last print statement conatined in it . So I know that the ends, But How do i tell this while loop to end? <\p>

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021596]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-10-06 21:33 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (161 votes), past polls