in reply to Forking Issue

how about:
my $start = time; while (time < $start + 1) { print "yay"; }
Ok - no fork, but it does what it needs - whatever that may be!

$ perldoc perldoc

Replies are listed 'Best First'.
Re: Re: Forking Issue
by larryl (Monk) on Mar 17, 2001 at 20:59 UTC

    Or if you're fussy about the time interval:

    use Time::HiRes qw(gettimeofday tv_interval); my $t0 = [gettimeofday]; while (tv_interval($t0) < 1.23) { print "Yay!\n"; }

Re: Re: Forking Issue
by Anonymous Monk on Mar 17, 2001 at 21:22 UTC
    I appreciate that, but if a simple time trick would do the job of the real code, I would have done that. But as I said in the original post, "I need to get fork to somehow work like this."
      Why does it need to be fork? The Run commands in parallel works on both Windows and *nix (where fork is somewhat less portable). Will that do for your (unspecified) real task?
        I'm trying desperately to get a timeout for socket connections on Win32. Trying to do something other than have them just hang the program.
        *sigh*