Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: sprintf question

by AcidHawk (Vicar)
on Mar 16, 2004 at 08:45 UTC ( #336952=note: print w/ replies, xml ) Need Help??


in reply to sprintf to zero-pad on the right

What about using substr..?

my $strlen = "00000000"; my $string = "TEXT"; substr($strlen, -length($string)) = "$string";

You can then print "$strlen\n";

-----
Of all the things I've lost in my life, its my mind I miss the most.


Comment on Re: sprintf question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2015-07-04 10:42 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 (59 votes), past polls