Your skill will accomplish what the force of many cannot |
|
PerlMonks |
substr and strings on the outsideby JPaul (Hermit) |
on Aug 19, 2001 at 19:45 UTC ( [id://106032]=perlquestion: print w/replies, xml ) | Need Help?? |
JPaul has asked for the wisdom of the Perl Monks concerning the following question:
Greetings all,
I'm doing a fair amount of work on editing strings inside a human-readable statement file, and have found using substr has its limits. Which will, quickly, complain of 'substr outside string'. Admittedly, I understand _why_ perl is doing it - but I'd rather perl just stuck in a few leading " "s and not complain at me about it. Any thoughts on a way to do this _without_ initialising all the strings to 80 chars w/padded spaces - and then for the sake of filesize, removing all trailing spaces after text and before the newline marker?
Cheers, -- Alexander Widdlemouse undid his bellybutton and his bum dropped off --
Back to
Seekers of Perl Wisdom
|
|