in reply to Best practice for sychronous output handling using open3()?

with only skimming over the code, i wonder why you have three variables assigned to the same thing?
my $cmdin=gensym; my $cmdout=gensym; my $cmderr=gensym;
Why not just $cmdstuff = gensym?

That said, it seems like this would be a job for something that's probably been written already. I know for sure there are a lot of cron scripts out there...have you looked on CPAN?

meh.

Replies are listed 'Best First'.
Re^2: Best practice for sychronous output handling using open3()?
by ikegami (Patriarch) on May 11, 2006 at 03:02 UTC

    gensym (in Symbol) returns a ref to a new glob every time it's called.

    my $cmdin=gensym; my $cmdout=gensym; my $cmderr=gensym; open3($cmdin, $cmdout, $cmderr, $cmd);

    is like

    my $cmdin=gensym; my $cmdout=gensym; my $cmderr=gensym; open3(\*IN, \*OUT, \*ERR, $cmd);

    without the risk of conflicting names.

      my mistake. clearly i didn't do my research. downvote as needed.
      meh.