array::Compare - Perl extension for comparing arrays

P

ppapro

Hi

I've tried to use array::Compare module but got an error that "Can't
locate object method "Sep" via package "Array::Compare".

Did someone have same error before ? I am just trying to run it in
same way as excample in documentation.
 
A

anno4000

ppapro said:
Hi

I've tried to use array::Compare module but got an error that "Can't
locate object method "Sep" via package "Array::Compare".

Did someone have same error before ? I am just trying to run it in
same way as excample in documentation.

Show your code. This runs for me without an error:

use Array::Compare;
my $cmp = Array::Compare->new;
$cmp->Sep( '|');

That said, the Array::Compare module looks like a rather weak
attempt at array comparison. The technique is to join() the
array elements using a separator and comparing the resulting
strings. This is not applicable to arrays that contain other
things than plain scalars. Even for plain scalars you'd have
to know in advance a separator that will not appear in any of
the array elements.

There are modules on CPAN that do a better job in array comparison.
One is Test::More with its eq_array() function.

Anno
 

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
474,202
Messages
2,571,057
Members
47,665
Latest member
salkete

Latest Threads

Top