Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: redirect stream from wirte; to $string

by thezip (Vicar)
on Jan 31, 2011 at 04:48 UTC ( #885196=note: print w/ replies, xml ) Need Help??


in reply to redirect stream from wirte; to $string

sprintf and printf are your huckleberries...

The first argument is the format specification, which is then followed by a list of variables that directly correspond to the "placeholders" specified in the format.

For example,

printf "%05d", 32; # prints an integer 5 digits wide, with leading ze +roes, ie. 00032 printf "%32s", 'foo'; # prints the word 'foo' into an area 32 characte +rs wide

This doesn't even begin to scratch the surface of what sprint and printf do, but it is a place to start.


What can be asserted without proof can be dismissed without proof. - Christopher Hitchens


Comment on Re: redirect stream from wirte; to $string
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885196]
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: (6)
As of 2015-07-28 04:49 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 (252 votes), past polls