Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Format, empty vars, and fixed-width records

by BrowserUk (Patriarch)
on Apr 22, 2008 at 00:14 UTC ( #682057=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    [0] Perl> printf "%2.2s\n", $_ for 9, 99 .. 101;;
     9
    ...
    99
    10
    10
    
  2. or download this
    printf "%-8.8s\n", sprintf '%8f', $_ 
        for map{ 1.23456789 * $_} map{ "1e$_" } -10 .. 10;;
    ...
    12345678
    12345678
    12345678
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2023-06-07 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (29 votes). Check out past polls.

    Notices?