JPaul has asked for the wisdom of the Perl Monks concerning the following question:
Greetings all,
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?
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:
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.my $f = " "; substr($f, 5, 5, "12345");
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 --
Back to
Seekers of Perl Wisdom