in reply to When every 2 lines of a file (sans first) should be 1...

Assumes lines are always paired after the header line:

use strict; use warnings; print scalar <STDIN>; while (<STDIN>) { chomp; print $_, scalar <STDIN>; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: When every 2 lines of a file (sans first) should be 1...
by tuxz0r (Pilgrim) on Dec 04, 2007 at 19:52 UTC
    I like both CountZero's and BrowserUK's solutions. They are short and readable. However, since the version I was going to post is similar to BrowserUK's, I have to say I'm a little baised toward his solution. ;) The less code I need to read through to decipher functionality, the better.

    ---
    s;;:<).>|{>?\\^0<|)=|*?=>|!./>(%<|:%<,|(!#+%<{;;y; -/:-@[-`{-};`-{/" -;;s;;$_;see;
    Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.