Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Using exit

by steves (Curate)
on Dec 30, 2004 at 16:34 UTC ( [id://418301]=note: print w/replies, xml ) Need Help??

in reply to Using exit

exit will cause the process to stop running. To restart it and pick up at another location, you'd have to save some sort of data before exiting that would tell you where to pick up, then load and use that data to conditionally execute code on restart. This doesn't sound like a good design to me. Are you sure you don't want to just sleep for 3 seconds, then continue on?

Replies are listed 'Best First'.
Re^2: Using exit
by Anonymous Monk on Dec 30, 2004 at 16:41 UTC
    Tried but it doesn't work the way I want cause when I use sleep(3); it doesn't display what I already have processed on the browser it just seats there and of course "sleep" for 3 seconds. and using exit displays everything at that point to the browser, I just need some similar trick to display whatever at some point in my program and than move on.
      if you're trying to get things to display to the browser, there are other things to do:
      to force writes to be "immediate". (i'm forgetting the proper term .. not enough coffee yet this morning ... )

      the reason  exit is sending the output to the browser is because the write buffer is closed, like a  close on a filehandle.

      It sounds like you are developing a CGI application. If this is the case, turning off output buffering may ensure that the output from the script is displayed in the browser:
        Yes I am, and I am using $|++ already, but at some point I would like to have what the exit does but no success yet.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-07-16 19:14 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.