diotalevi has asked for the wisdom of the Perl Monks concerning the following question:
The following codes shows that when I attempt to trap regular expression syntax with overload.pm, as documented, use of interpolation causes only static fragments to be passed through to my package. Is there a standard way I can get access to the final generated string or to the original including the $bar interpolation? I'm about to write a piece of syntax like (?&91;NAME&93;...) but this requires that I be able to see the closing parenthese.
use My::Package; /<<<$bar>>>/; # RE=<<< # RE=>>>
My/Package.pm
package My::Package; use overload; sub import { overload::constant qr => \ &convert } sub convert { my $re = shift; print "RE=$re\n"; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: overload::constant passes fragments, not whole strings under interpolation. Help?
by jql (Acolyte) on Sep 17, 2005 at 00:22 UTC | |
by diotalevi (Canon) on Sep 17, 2005 at 01:59 UTC | |
|
Re: overload::constant passes fragments, not whole strings under interpolation. Help?
by sauoq (Abbot) on Sep 16, 2005 at 23:59 UTC | |
|
Re: overload::constant passes fragments, not whole strings under interpolation. Help?
by Tanktalus (Canon) on Sep 17, 2005 at 00:24 UTC |