in reply to substr function
Search for pp_substr in pp.c.
It's not a good idea to want to modify substr on that level. You can use subs (I think) and override substr with your own custom function. That makes it still a bad idea, but at least you can write your replacement in Perl that way.
What problem are you trying to solve that involves replacing substr?
Update: subs seems to be the wrong module, but I'm sure I remember a module that allowed one to replace built-ins. Maybe I'm just thinking of CORE::GLOBAL:: though:
BEGIN{ *CORE::GLOBAL::substr=sub($$$) { die }; } print substr 'foo',2,3;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: substr function
by tej (Scribe) on Jan 13, 2011 at 15:02 UTC | |
by Corion (Patriarch) on Jan 13, 2011 at 15:06 UTC | |
by Jim (Curate) on Jan 13, 2011 at 16:41 UTC | |
by ikegami (Patriarch) on Jan 13, 2011 at 16:56 UTC | |
by Jim (Curate) on Jan 13, 2011 at 17:11 UTC | |
by ikegami (Patriarch) on Jan 13, 2011 at 17:30 UTC | |
|