in reply to Re: Encode::Detec::Detector: This is not an SV reference error
in thread Encode::Detec::Detector: This is not an SV reference error

May be changing the line
my $l; to my $l=0;
will help here coz the undefined value of $l is passed at first to the handler method.