You say, re your second code block, "Works just fine."
That's interesting. My milage varies:
C:\>perl -E "use 5.018; use strict; my $c; $c = &func() ? say '$c foun
+d!' : say 'None!';"
Undefined subroutine &main::func called at -e line 1.
... but...
C:\>perl -E "use 5.018; use strict; sub func {say 'in func()';}my $c;
+$c = &func() ? say '$c found!' : say 'None!';"
in func()
$c found!
Aside from returning the declaration of $c to the one liner and the variant quoting, I see no diffs. Can you explain?