Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 avoiding work at the Monastery: (5)
As of 2014-08-23 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls