in reply to Conditional initialization of lexical (my) variables

you already got an explanation at your previous question, here: Re: Conditional initialization of my-variables (runtime)

concerning your code:

>

my $my_var = "default" unless defined $param; $my_var //= $param;

please try this instead

my $my_var = $param // "default";

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery