Subject: | Constructor silently fails on incorrect parameters |
Date: | Tue, 11 Aug 2015 10:23:49 +0300 |
To: | bug-Text-CSV [...] rt.cpan.org |
From: | Gabor Szabo <gabor [...] szabgab.com> |
If I forget to pass a hash ref and instead pass only key-value pairs:
my $csv = Text:CSV->new(
sep_char => 1
);
Text::CSV will return an undef without complaining.
I guess this might be a common error.
Would it be possible to check if the parameter the constructor gets is a
hash -ref
if there is any attribute, and die or at least warn if the user passed
something that is
not a hash-ref?
Gabor