in reply to Re^3: Using Linux Commands in Perl - `Backticks`
in thread Using Linux Commands in Perl - `Backticks`

Considering that select() already has a timeout, why would you use alarm?
  • Comment on Re^4: Using Linux Commands in Perl - `Backticks`

Replies are listed 'Best First'.
Re^5: Using Linux Commands in Perl - `Backticks`
by Corion (Patriarch) on Oct 01, 2010 at 12:31 UTC

    I've never used select with a timeout, so that's why I wasn't aware of that additional parameter. As you say, there is no reason to use alarm, as select does everything that's needed to read from a program for a limited amount of time.

      I've never used select with a timeout,
      I guess you mean that you've never used select (the select that's a wrapper around the select(2) system call) ;-)? You cannot use 2 or 3 arguments for select - if you use select to know the status of filehandles, you must give it a timeout. It won't compile otherwise.

        I should have said "with a non-zero timeout".