in reply to Re: Abbreviation regex?
in thread Abbreviation regex?
++ I like the thinking outside the box. That said, you can only do that if $str comes from a trusted source. If, for example, you get it from user input, try this as input:
Of course, that's only really a problem if you have enabled use re 'eval'; - but if you already need that for other purposes, you'll need to be very careful.abbr(?{system qw(format c:)})ev
In fact, your "outside the box" is almost exactly described in the documentation for the (?{ code }) construct in perlre where it goes into a bit more detail and talks about ways to mitigate it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Abbreviation regex?
by ikegami (Patriarch) on Jan 16, 2006 at 18:07 UTC | |
|
Re^3: Abbreviation regex?
by fishbot_v2 (Chaplain) on Jan 16, 2006 at 18:02 UTC |