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

Re: reading from a textfile

by Wonko the sane (Deacon)
on Jun 14, 2004 at 14:46 UTC ( #366563=note: print w/ replies, xml ) Need Help??


in reply to reading from a textfile

Just a different way to do it.

#!/usr/local/bin/perl -w use strict; my $data = do { local($/); <> }; print qq{$1\n} if ( $data =~ /(Testnok =[^>]+>)/s )

Or all right on the command line. Prob a cleaner way to do this though,
but I dont have my Camel book with me. Bet this could be done better with a couple more switches.

perl -e 'print $1 if ( do{local $/; <>} =~ /(Testnok =[^>]+>)/s)' data +.txt

Wonko


Comment on Re: reading from a textfile
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (15)
As of 2014-07-24 18:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (165 votes), past polls