I wish to compare two objects to determine if the attribute values are the same. I'm finding very little guidance on this issue anywhere. There is the Data::Compare module but from what I gather I will need to write my own plugin module to do the comparison. I'd be stunned if there is nothing out there that makes it trivial to compare the attributes of two objects against one another but I can't find it.
Any ideas?
Update
Here are the class attributes (written with Moose syntax)
has 'start_time' => ( is => 'rw', isa => 'Time::Piece', ); has 'end_time' => ( is => 'rw', isa => 'Time::Piece', ); has 'title' => ( is => 'rw', isa => 'Str', ); has 'location' => ( is => 'rw', isa => 'Str', ); has 'address' => ( is => 'rw', isa => 'Str', ); has 'document_url' => ( is => 'rw', isa => 'Str', ); has 'event_url' => ( is => 'rw', isa => 'Str', ); has 'event_id' => ( is => 'rw', isa => 'Str', ); has 'status' => ( is => 'rw', isa => 'Str', ); has 'post_id' => ( is => 'rw', isa => 'Int', );
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Best way to compare two objects? by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |