Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: how to read multiple line from a file

by 2teez (Priest)
on Apr 13, 2013 at 05:46 UTC ( #1028486=note: print w/ replies, xml ) Need Help??


in reply to how to read multiple line from a file

Does this work for you?

use warnings; use strict; use feature 'say'; my $str = do { local $/; <DATA>; }; say join " " => grep { $_ if /fox/ .. /over/ } split /\n/, $str; __DATA__ the quick brown fox jumped over the unfortunate dog
Output
fox jumped over

NOTE:
I used Athanasius data since the OP has none.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: how to read multiple line from a file
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2014-07-31 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (252 votes), past polls