Please confirm bug in SHLOMIF > Error-0.17 > Error

D

Derek Basch

Hello Everyone,

I was hoping someone could confirm a bug for me. I believe I have found
a bug in the Error module. The Synopsis section shows this example:

throw Error::Simple -text => "Oops!" if $other_condition;

However, this style of instantiating a Error::Simple object is broken.
The constructor for Error::Simple does not convert the parameters array
into a hash as expected:

265 sub new {
266 my $self = shift;
267 my $text = "" . shift;
268 my $value = shift;
269 my(@args) = ();

I believe it should be:

265 sub new {
266 my (%params) = @_;

and the parameters should be dereferenced as hash elements throughout.
Can anyone confirm?

Thanks,
Derek Basch
 
D

Derek Basch

Thanks for the help. I am sorry I didn't expand my examples enough. I
certainly wasn't hoping to find a bug but rather trying to figure out
something that had been "bugging" me for many hours. I will submit this
to CPAN.

Thanks,
Derek Basch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top