Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: One liner

by Roy Johnson (Monsignor)
on Jun 02, 2009 at 15:21 UTC ( #767633=note: print w/replies, xml ) Need Help??


in reply to One liner

You need to tell it to read the file all at once instead of line-by-line. Then you need to adjust your regex to do multiline matching (and not to be so greedy as to eat the numbers):
perl -0777 -ne 'if (m/^Total SE ON.*?(\d+)/ms) {print "$1\n"}' *
Update: as ikegami notes, paragraph mode would also be suitable. The shorthand for that is -00 (those are zeroes). See perlrun

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://767633]
help
Chatterbox?
[Perl300]: I have a quick question about the Meta CPAN
[Perl300]: On any modules pod page, what does the date on top left corner below authors name indicate?
[Corion]: Likely the date of the release of the module
[Corion]: Yep, seems like that

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-12-11 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (310 votes). Check out past polls.

    Notices?