How can I keep only the first five lines in a Perl scalar?

Posted by Mr. Vile on Stack Overflow See other posts from Stack Overflow or by Mr. Vile
Published on 2009-04-22T10:31:23Z Indexed on 2010/03/14 12:25 UTC
Read the original article Hit count: 229

Filed under:
|
|
|
|

From any kind of scalar, what regex could I use to match the first five lines of it and discard the rest?

© Stack Overflow or respective owner

Related posts about perl

Related posts about regex