By using overload and overloading q for the constant string parts and the "."-operator for the string concatenations in between.
Cheers Rolf
UPDATE: If this whole thread is just about interpolating method-calls in strings/templates, you should consider the De/Ref-trick with @{[...]} :
perl -e ' {package test; sub test {return "test"}}; $a=[]; bless $a, test; print "@{[$a->test]}" '
please note: here $a->test is called in list context, for scalar context use ${\$a->test} !
UPDATE2: After rereading overload I have the impression that overloading "" might be the approach to overload qq ... but this might also affect all other possible stringifications...(!?!)
In reply to Re^5: How to simulate a preprocessor macro without one?
by LanX
in thread How to simulate a preprocessor macro without one?
by AriSoft
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |