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.
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");
Cheers,
JP
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substr and strings on the outside
by OeufMayo (Curate) on Aug 19, 2001 at 20:23 UTC | |
|
Re: substr and strings on the outside
by George_Sherston (Vicar) on Aug 19, 2001 at 20:29 UTC | |
|
(elbie): substr and strings on the outside
by elbie (Curate) on Aug 19, 2001 at 20:20 UTC | |
|
Re: substr and strings on the outside
by synapse0 (Pilgrim) on Aug 20, 2001 at 01:52 UTC | |
|
Re: substr and strings on the outside
by JPaul (Hermit) on Aug 20, 2001 at 02:10 UTC | |
by scott (Chaplain) on Aug 20, 2001 at 02:45 UTC | |
by mandog (Curate) on Aug 20, 2001 at 07:05 UTC |