On Friday, 21 January 2022, 17:49:47 CET, Ovid via perl5-porters <perl5-porters@perl.org> 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. Er ... because someone "didn't" explicitly assign to it. (Damned typos (sic)) Best, Ovid -- IT consulting, training, specializing in Perl, databases, and agile development http://www.allaroundtheworld.fr/. Buy my book! - http://bit.ly/beginning_perlThread Previous | Thread Next