Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Finding largest common subset in lists?

by Aragorn (Curate)
on Jun 05, 2003 at 10:21 UTC ( [id://263273]=note: print w/replies, xml ) Need Help??


in reply to Re: Finding largest common subset in lists?
in thread Finding largest common subset in lists?

With use warnings it gives a Use of uninitialized value in string eq at... warning. Small off-by-one error.

Replacing

push @tmp, $a[$_] if ( $a[$_ + 1]) eq ( $b[$map{$a[$_]} + 1] ) or @tmp >= 1;
with
push @tmp, $a[$_] if ($a[$_ + 1] and $b[$map{$a[$_]} + 1] and ( $a[$_ + 1]) eq ( $b[$map{$a[$_]} + 1] ) or @tmp >= 1);
makes Perl happy again.

Arjen

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://263273]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-26 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found