$foo = "a string"; print "${"; foo} or is it?
__output__
a string or is it?
Nice one!
That's even simpler than the examples I found - you've demonstrated the problem without the hash lookup.
Re:Nice!
broquaint on 2002-11-27T11:05:18
The code was adapted from japhy's New Obfuscation Trick!. You'll get it whenever you use brace to quote/dereference something in an interpolated string e.gWould love to knock up a patch but wouldn't have the foggiest where to begin (maybe it's time to finish E&EP).$foo = "a string";
print "[${";
foo}]
$bar = qq<[${>;
foo}]
print $bar;
@baz = qw( a list of strings );
print qq([@{);
baz}]
$str = "dereferenced";
$strstr = 'str';
print "[${";
$strstr}]
%hash = qw( ichi ni );
print "[$hash{"
ichi}]
__output__
[a string]
[a string]
[a list of strings]
[dereferenced]
[ni]