Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028486]
help
Chatterbox?
[erix]: (SCNR)
[ELISHEVA]: I may have to resort to SOPW - but was hoping that this would be something simple
[erix]: I'd just remove the BOM, it is pretty simple
[ELISHEVA]: Simple yes. and I did consider that. but this isn't one off . An important data source that I don't control is generating bom prefixed utf8 files and I'd rather not have to be munging files every few months.
[erix]: on teh other hand a SOPW is pretty much garanteed to get an answer from tux (and probably the module fixed)
[ELISHEVA]: plus it bugs me that something that *should* be simple, *should* work- unicode and noms aren't exactly the new kids on the block
[ELISHEVA]: well then since the obvious possible mistakes on my part have been ruled out, SOPW it is.
[ELISHEVA]: the data source, or one of them, is the OECD - they provide a *lot* of data that ought to be easily available to perl programmers.
[erix]: it might be cunning to mention the module in the title... :)
[ELISHEVA]: fancy that - a title that actually describes the problem :-)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-05-28 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?