It thinks it's interpolating a variable $x::... and then it gets stuck
because it sees $y instead of the rest of a variable name. You can use
braces to control what's part of the name:
pyanfar Z$ 6 'my $x = "abc"; my $y = "def"; say "{$x}::{$y}"'
abc::def
Otherwise, you couldn't interpolate the name of a variable $x::y in some
other module.
On Fri, Sep 14, 2018 at 7:32 PM ToddAndMargo <[email protected]> wrote:
> What is this all about?
>
>
> $ p6 'my $x="abc"; my $y="def"; say "$x::$y";'
> ===SORRY!=== Error while compiling -e
> Malformed lookup of ::$y; please use ::('$y'), ::{'$y'}, or ::<$y>
> at -e:1
> ------> my $x="abc"; my $y="def"; say "$x⏏::$y";
>
> $ p6 'my $x="abc"; my $y="def"; say "$x\::$y";'
> abc::def
>
> $ p6 'say "abc::def";'
> abc::def
>
> What does the compiler think `::$y` is?
>
> Many thanks,
> -T
>
--
brandon s allbery kf8nh
[email protected]