> : But when you start interpolating, you get into a big mess:
> : h<\qq[$interpolated]> = want(); # ???
> : h<<$foo>> = want(); # ???
>
> I think that, as with functions called in unknown context, we should
> just force the RHS here to list context, and rely on the RHS to add
> extra context as necessary if they really mean scalar. If something
> really is always producing a scalar value, it doesn't matter if it's
> called in list context.
That makes sense, but that would make
%num_of_lines<file> = @file
not DWIM... of course that would translate into
%num_of_lines<file> = scalar @file
so maybe that's OK.
> Any bit of expression by default evaluates at ordinary run time, but can
> be forced to evaluate earlier by surrounding context.
What you're saying is that
BEGIN { $c=1 }
$c=0;
q:c($c)/.../
interpolates, because the $c in line three is evaluated after the $c in line
one but before the $c in line two, right? If you don't obfuscate on purpose
(like I did), that makes sense.
--
-Roie
v2sw6+7CPhw5ln5pr4/6$ck2ma8+9u7/8LSw2l6Fi2e2+8t4TNDSb8/4Aen4+7g5Za22p7/8
[ http://www.hackerkey.com ]