http://qs321.pair.com?node_id=106032

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.
Take this:

my $f = " "; substr($f, 5, 5, "12345");
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,
JP

-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --