Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2018-07-22 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (454 votes). Check out past polls.

    Notices?