Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-05-24 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?