in reply to always in quest to eliminate temporary variables

I think what you're trying to do is:
$next_line = $1 . $next_line if s/\n(.*)//s;
right?

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: always in quest to eliminate temporary variables
by Ovid (Cardinal) on Jun 16, 2000 at 03:23 UTC
    So simple. So obvious. I wonder how many Monks (including myself) are going to kick themselves for missing that one.
RE: RE: always in quest to eliminate temporary variables
by Adam (Vicar) on Jun 16, 2000 at 20:07 UTC
    I thought about that, but I wasn't sure if $1 qualified as a temporary variable.
      Since "eliminate temporary variables" is an artificial (read: meaningless) requirement, it can be interpreted in arbitrary ways.

      -- Randal L. Schwartz, Perl hacker

        When you say meaningless, do you mean that I was correct in my assumption that temp variables get generated (or not) at the compiler's whim? I know that in C++ compilers temp variables are generated when they are needed and optimized out when they are not. I hope that perl does something similar, which of course eliminates this whole thread, but I don't know.