Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: how to find last word match ?

by bh_perl (Monk)
on Nov 24, 2010 at 07:27 UTC ( #873370=note: print w/replies, xml ) Need Help??


in reply to Re: how to find last word match ?
in thread how to find last word match ?

<hi>
This is my opinion by using shell script
system ("cat file.txt |grep "Baki" |tail -1");

Replies are listed 'Best First'.
Re^3: how to find last word match ?
by eyepopslikeamosquito (Bishop) on Nov 24, 2010 at 07:38 UTC
      perl -e 'print((grep/Baki/,<>)[-1])' file.txt

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2023-02-01 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (10 votes). Check out past polls.

    Notices?