Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Preserve trailing spaces with write format?

by stephen (Priest)
on Apr 17, 2002 at 18:42 UTC ( #159934=note: print w/ replies, xml ) Need Help??


in reply to Preserve trailing spaces with write format?

Instead of using formats, it may be easier to use sprintf.

# Print "Hi." left-justified padded out to 20 spaces. print sprintf('%-20s', "Hi.");

stephen


Comment on Re: Preserve trailing spaces with write format?
Select or Download Code
Re: Re: Preserve trailing spaces with write format?
by tachyon (Chancellor) on Apr 17, 2002 at 20:46 UTC

    Or perhaps simply:

    printf '%-20s', "Hi.";

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (20)
As of 2015-07-01 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (3 votes), past polls