Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Unwrapping the Dictionary

by BrowserUk (Patriarch)
on Aug 21, 2007 at 03:45 UTC ( [id://633990]=note: print w/replies, xml ) Need Help??


in reply to Unwrapping the Dictionary

This might suffice. It relies on the continuation lines starting (after the leading whitespace) with at least 3 non-space, non-':' characters.

#! perl -slw use strict; my $def =<<'EOD'; bean n 1: any of various edible seeds of plants of the family Leguminosae [syn: {edible bean}] 2: any of various seeds or fruits suggestive of beans 3: any of various leguminous plants grown for their edible seeds and pods [syn: {bean plant}] 4: informal terms for a human head [syn: {attic}, {bonce}, {noodl +e}, {noggin}, {dome}] v : hit on the head, esp. with a pitched baseball EOD $def =~ s[\n\s+(?=[^\s:]{3})][ ]smg or warn 'no match'; print $def; __END__ c:\test>junk bean n 1: any of various edible seeds of plants of the family Legumino +sae [syn: {edible bean}] 2: any of various seeds or fruits suggestive of beans 3: any of various leguminous plants grown for their edible seeds +and pods [syn: {bean plant}] 4: informal terms for a human head [syn: {attic}, {bonce}, {noodl +e}, {noggin}, {dome}] v : hit on the head, esp. with a pitched baseball

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found