This does what I need:
sub verify { my $ref = \pop; my $string = @_ ? shift : "<default>"; $$ref = $string; # Dummy action for testing } verify $a; verify "hello", $b; print "a=$a b=$b\n"; # Expect a=<default> b=hello
In reply to Re^2: Optional parameter before reference (!proto)
by Neutron Jack
in thread Optional parameter before reference
by Neutron Jack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |