Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: An Elegance Question

by chromatic (Archbishop)
on Apr 13, 2000 at 23:12 UTC ( [id://7518]=note: print w/replies, xml ) Need Help??


in reply to An Elegance Question

On the ridiculous end of the scale, why not a hash of arrays? If you're going to use your WORDS in order:
my %words = ( NOUN => [], VERB => [], ADJ => []); # use stephen's part_of_speech sub push @{ $words{$part_of_speech} }, $word;
Then, when you do your substitution: $story =~ s/[(NOUN|VERB|ADJ)]/shift @{ $words{$1} }/eg; I wouldn't do it this way, but it's food for thought.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-19 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found