Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: List Compare

by inman (Curate)
on Oct 21, 2005 at 14:32 UTC ( #502011=note: print w/replies, xml ) Need Help??


in reply to Re: List Compare
in thread List Compare

You beat me to it!! I had it the other way round though as per the OPs example. The joined @a is only calculated once and then matched against the regex made from joining @b with .*?
my @a= qw (a b c d e f); my @b= qw (a b c); my $joined_a = join '', @a; my $joined_b = join '.*?', @b; print "yes!\n" if $joined_a =~ /$joined_b/;

But I guess there are no prizes for coming second...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2018-11-15 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (192 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!