« YAPC::Asia Tokyo 2010 #yapcasia | Main | Yahoo! Media Player »

02 November 2010

plural

I forgot how to display plural in Perl. Though I read Advanced Perl Programming before. Then it's solved by Lingua::EN::Inflect.

$ perl -MLingua::EN::Inflect=PL -le 'print PL("blog", 2)'
blogs

By the way, in python world, pipy has same module named inflect.

$ easy_install inflect
$ python
>>> import inflect
>>> p = inflect.engine()
>>> p.plural('blog', 2)
'blogs'

Okay, if I forgot again, first of all I'll search my blog :)

0596004567 Advanced Perl Programming
Simon Cozens
Oreilly & Associates Inc 2005-08-30

by G-Tools

TrackBack

TrackBack URL for this entry:
http://bb.lekumo.jp/t/trackback/517129/31022563

Listed below are links to weblogs that reference plural:

Comments

If you want an itaernctive shell in perl, the easiest way is to fire up the perl debugger in command mode.just run perl -de 1Be careful declaring lexical my vars this way. Scope becomes a single line. Aaron

My partner and Ι absolutely love yоur blog and fiոd the majority of yоur post's tօ be precisely what I'm lookinɡ fοr. Ɗoes one offer guest writers to write content tߋ suit ʏour needs? I wouldn't mind creating a post οr elaborating օn a lot of the subjects yօu write about here. Aɡain, awesome web site!

Post a comment

Access Ranking

Powered by Six Apart
Sponsored links