This code is found in Promises.pms _set_warn_on_unhandled_reject:
( ' at ', join ' line ', @{$self->{_caller}} ) x !! $self->{_caller}
But even if $self->{_caller} is undef, @{$self->{_caller}} is still evaluated.
To reproduce:
#!/usr/bin/perl -w
use strict;
use Promises;
my $p = Promises::rejected();
# Simulate a late loaded class using warn_on_unhandled_reject
Promises->import('warn_on_unhandled_reject' => [1]);
which gives the error:
(in cleanup) Can't use an undefined value as an ARRAY reference at ...Promises.pm line 50.
This code is found in
Promises.pm
s_set_warn_on_unhandled_reject
:But even if
$self->{_caller}
is undef,@{$self->{_caller}}
is still evaluated.To reproduce:
which gives the error: