Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Can I clean this up??

by dimmesdale (Friar)
on Jul 25, 2002 at 01:21 UTC ( [id://185083]=note: print w/replies, xml ) Need Help??


in reply to Can I clean this up??

You may want to check out Lingua::EN::Inflect -- it takes a singular form of a noun/verb/some adjectives and spits out the plural form.

From the docs, it can do it conditionally as such:

# CONDITIONALLY FORM THE PLURAL print "I saw $cat_count ", PL("cat",$cat_count), "\n";

Your conditional statement just wants to make the is/are look right for the end user -- now you've gotten helpful repiles for something that works specifically for the is/are part, but in the future if you need more flexibiilty you can consider the module.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-26 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found