Skip Menu |

This queue is for tickets about the Data-Pareto CPAN distribution.

Report information
The Basics
Id: 45220
Status: resolved
Priority: 0/
Queue: Data-Pareto

People
Owner: PWES [...] cpan.org
Requestors: emmanuel.Jeannot [...] loria.fr
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.01
Fixed in: 0.03



Subject: Problem with the example
Date: Wed, 22 Apr 2009 17:42:32 +0200
To: bug-Data-Pareto [...] rt.cpan.org
From: Emmanuel Jeannot <emmanuel.Jeannot [...] loria.fr>
Hi. I tried the example, but it is not working: Show quoted text
> more test.pl
use Data::Pareto; # only first and third columns are used in comparison # the others are simply descriptive my $set = new Data::Pareto(columns => [0, 2]); $set->add( [ 5, "pareto", 10, 11 ], [ 5, "dominated", 11, 9 ], [ 4, "pareto2", 12, 12 ] ); # this returns [ [ 5, "pareto", 10, 11 ], [ 4, "pareto2", 12, 12 ] ], # the other one is dominated on selected columns $set->get_pareto_ref; Show quoted text
> perl test.pl
Can't use string ("columns") as a HASH ref while "strict refs" in use at /Library/Perl/5.8.8/Data/Pareto.pm line 111. Can you tell me what's wrong? Best regards, --Emmanuel
You are right, the problem is with example. new() expects a single argument, hashref. To make it work, please change the line: my $set = new Data::Pareto(columns => [0, 2]); to my $set = new Data::Pareto({ columns => [0, 2] }); The change to documentation will go with the next release.