http://www.perlmonks.org?node_id=152332


in reply to split mailbox one-liner

Not that we're golfing, but a "-n" loop that ends in "print" seems odd. {grin} I've used something like:
perl -pe 'open STDOUT, ">out".++$n if /^From /' <in >before-first-outp +ut
before, with the advantage that the original pre-first-From output ends up in a file that is not part of the series.

-- Randal L. Schwartz, Perl hacker