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

Re^2: Generating standard length strings

by crashtest (Curate)
on Apr 14, 2005 at 19:20 UTC ( [id://447920]=note: print w/replies, xml ) Need Help??


in reply to Re: Generating standard length strings
in thread Generating standard length strings

Note that your sub will cut off the input string if its length is larger than the padding width:
sub rpad { pack "A$_[1]", $_[0] }; my $string = 'averylongstringthatislongerthan10charsforsure!'; print "]", rpad($string, 10), "[\n"; __END__ ]averylongs[
I am not sure if that is what the OP intended.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found