Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: get n lines before or after a pattern

by Anonymous Monk
on Jul 25, 2012 at 15:46 UTC ( #983692=note: print w/replies, xml ) Need Help??


in reply to get n lines before or after a pattern

Search for grep, the Unix command, implementation in Perl. There are at least one such implementations posted around here (don't have the (search) links handy); another was posted long ago in comp.lang.perl.misc newsgroup. Yet another is App::Ack; refer to &print_line_with_context & &get_context subs.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983692]
help
Chatterbox?
[LanX]: DBI: is there an easy method to get the content of a column as an array
[LanX]: values %{ $DBI->fetchrow_has href('column_name' }
[LanX]: ehm ... fetchall_hashref
[Jenda]: my int @a = ^5_000_000 Coerces the argument to Numeric, and generates a range from 0 up to (but excluding) the argument.
[Jenda]: The apparent design principle of Perl6 operators was "Let's confuse 'em dudes." Whose braindead idea was this particular operator and the three hundred around it?

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-07-16 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (344 votes). Check out past polls.

    Notices?