Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Can I clean this up??

by dimmesdale (Friar)
on Jul 25, 2002 at 01:21 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2023-03-28 02:31 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (66 votes). Check out past polls.