Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Parsing a line from a line with one line of perl code.

by zer (Deacon)
on Nov 09, 2007 at 00:51 UTC ( [id://649837]=note: print w/replies, xml ) Need Help??


in reply to Parsing a line from a line with one line of perl code.

($_)=<DATA>=~/<!\[CDATA\[(.*?)]]/; __DATA__ <Prompt><![CDATA[Please describe your experience maintaining batteries +, associated power equipment and diesel. . (If you do not have this e +xperience, please enter ?none? and continue to the next question). ] +]></Prompt>

The <DATA> can be replaced with a variable that holds the info. The ($_) is getting the response of the regular expression in list format. So the $1 variable which returns the first group gets placed into $_.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-18 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found