Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Printing line before matching expression

by jaredor (Priest)
on Sep 11, 2013 at 18:56 UTC ( [id://1053549]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    use Modern::Perl;
    ...
    caz
    ciz
    cuz
    
  2. or download this
    my $lbl; # lookback line
    while ($buff[$.%($lb+1)] = ($_ = <DATA>)) {
        print $lbl if $lbl = $buff[($.+1)%($lb+1)] and /$match/;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1053549]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-25 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found