|P is for Practical|
substr and strings on the outsideby JPaul (Hermit)
|on Aug 19, 2001 at 19:45 UTC||Need Help??|
JPaul has asked for the wisdom of the Perl Monks concerning the following question:
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?
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --