Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: TIMTOWTDI meets Rube Goldberg

by iguanodon (Priest)
on Aug 06, 2011 at 23:14 UTC ( #919004=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub add_zero { $x = shift; return $x if ( $x > 9 ); return ( '0' . $x 
    +) if ( $x < 10 ); }
    
  2. or download this
    sub pad
    {
    ...
        return $n if $n =~ /\D/;
        return $n > 9 ? $n : "0$n";
    }
    
  3. or download this
    $n = $n =~ /^\d/ ? sprintf('%02d', $n) : $n;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-07-03 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?