Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

List::Compare asking for two references

by Lotus1 (Vicar)
on Feb 18, 2021 at 18:41 UTC ( #11128533=perlquestion: print w/replies, xml ) Need Help??

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 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 (Canon) 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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11128533]
Approved by haukex
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2021-12-06 03:40 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (31 votes). Check out past polls.