in reply to Math::Round::Var::round() takes no action when a number is not supplied
It seems to raise a perfectly valid exception for me:
sub round { my $self = shift; my $rnd = $self->{precision}; my $number = shift; return(sprintf("%0.${rnd}f", $number)); };; print round( {precision=>3}, 1.23456 );; 1.235 print round( {precision=>3}, 1 );; 1.000 print round( {precision=>3} );; Use of uninitialized value $number in sprintf at ... 0.000
(Though quite why you'd use a module for this is beyond me?)
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Math::Round::Var::round() takes no action when a number is not supplied
by metaperl (Curate) on Aug 31, 2011 at 02:25 UTC | |
by BrowserUk (Patriarch) on Aug 31, 2011 at 02:34 UTC | |
by metaperl (Curate) on Aug 31, 2011 at 15:38 UTC | |
by BrowserUk (Patriarch) on Aug 31, 2011 at 15:59 UTC |
In Section
Seekers of Perl Wisdom