Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Simple but thought-provoking programming tasks [OT]

by Cody Pendant (Prior)
on Apr 16, 2007 at 02:00 UTC ( [id://610245]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for(1 .. 31){
      print $_ . suffix($_) . "/n";
    }
    
  2. or download this
        @suffixes = ( undef, 'st','nd','rd' ... etc);
        return $suffixes[$_[0]];
    
  3. or download this
        $_[0]=~/(\b|[^1])(\d)$/;qw(0 st nd rd)[$2]or'th'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://610245]
Approved by BrowserUk
Front-paged by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-18 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found