Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: TIMTOWTDI meets Rube Goldberg

by iguanodon (Priest)
on Aug 06, 2011 at 23:14 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found