Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: List Compare

by Roy Johnson (Monsignor)
on Oct 21, 2005 at 20:55 UTC ( #502125=note: print w/replies, xml ) Need Help??


in reply to List Compare

Here's a Lispy version (which modifies the arrays):
my @a=qw(a b c d e f); my @b=qw(a b c); sub head_eq(\@\@) { my ($long, $short) = @_; @$short == 0 or (@$long and shift @$long eq shift @$short and &hea +d_eq) } print "Equal!\n" if head_eq(@a, @b);

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2018-12-14 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (69 votes). Check out past polls.

    Notices?