in reply to perl one liner to print a line

perl -lne 'die"$_\n"if$.==4'

perl -pe '$_=($.-4)?"":$_'

Replies are listed 'Best First'.
Re^2: perl one liner to print a line (GOLF!)
by ikegami (Patriarch) on Dec 12, 2008 at 07:24 UTC

    die"$_\n" sends to STDERR, so you need to add " 2>&1".

    The second doesn't do the same thing as the other golfs so far. It reads the entire file whereas the other golfs spent extra character to stop after 4 lines. If reading the entire file is ok, then I put forth

    perl -lnE"$.^4||say" 123456789012345 15