perl par-packer exe file sleep() not working -


hello.pl file works fine:

print "hello world"; sleep(5); 

when convert hello.exe using par-packer, window sleep 5 sec won't print "hello world" - printed after 5 sec , window exits.

any solution appreciated. want print displayed 5 sec.

that issue of flushing buffer stdout. can either manually flush before sleep with

stdout->flush() # specific instance of $filehandle->flush() 

or can ask that file handle automatically flushed you.

stdout->autoflush(1); 

also can turn off 0 parameter.

lastly there's less readable special variable $| can assign 1 if you're doing kind of one-liner or code-golfing.


Comments