Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: List Compare

by Roy Johnson (Monsignor)
on Oct 21, 2005 at 20:55 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://502125]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found