http://qs321.pair.com?node_id=11128533

Lotus1 has asked for the wisdom of the Perl Monks concerning the following question:

This test script of List::Compare is returning an error:

Must pass at least 2 references to &new: at compare_lists.pl line 8.

I tried B::Deparse and it says syntax OK. I checked cpan> i List::Compare to verify I have the latest version (0.55). Any suggestions?

use warnings; use strict; use List::Compare; my @lines1 = qw( test1 test2 test3 ); my @lines2 = qw( test1 test2 test4 ); my $lc = List::Compare::new( \@lines1, \@lines2);

Replies are listed 'Best First'.
Re: List::Compare asking for two references
by jdporter (Paladin) on Feb 18, 2021 at 18:43 UTC

    Try List::Compare->new.

      That works. Thank you!

        Sure thing. But do you understand why it works? Check out perlootut and perlobj.