On Fri, 21 Jan 2022 16:49:22 +0000 (UTC) Ovid <curtis_ovid_poe@yahoo.com> wrote: > I knew my 3VL discussion went over like a lead balloon, but I > couldn't resist being cheeky ... > > use Unknown::Values; > > sub foo ($bar = unknown) { > say is_unknown $bar ? "unknown" : "known"; > } > > foo(); > > That prints "unknown", so if someone passed in `undef`, it will print > "known" because someone explicitly assigned to it. Wellsure but now you've just moved the goalpost - how to distinguish foo(unknown); foo(); Ultimately, this comes down to the fact that since it is trivially easy in perl to distinguish the values left in the @x array in: my @x = (undef); # or (unknown); my @x = (); The same easy distinction ought to be possible with subroutine arguments. It always has been so far. -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/Thread Previous | Thread Next