On Sat, 19 Jan 2019 08:03:37 -0800, jkeenan wrote: > OTOH, filtering out the arguments which are undefined values would be > consistent with the 'warn' and 'die' built-ins which 'carp' and > 'croak' emulate. > > ##### > $ perl -e 'warn("alpha", undef, "beta") unless 1 == 0;' > alphabeta at -e line 1. > > $ perl -e 'die("alpha", undef, "beta") unless 1 == 0;' > alphabeta at -e line 1. > ##### Eh, warn() and die() are not that nice. :) $ perl -w warn("alpha", undef, "beta"); Use of uninitialized value in warn at - line 1. alphabeta at - line 1. $ perl -w die("alpha", undef, "beta"); Use of uninitialized value in die at - line 1. alphabeta at - line 1. I say we just add the defined check because undef()'s just smash down to blank anyway. We "could": sub ret_backtrace { my ( $i, @error ) = @_; my $mess; - my $err = join '', @error; + if (warnings::enabled("uninitialized") && scalar grep {!defined} @error) { + carp "Use of unititialized...."; + } + my $err = join '', grep defined, @error; $i++; Thanks. --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=133776Thread Previous