diff --git a/challenge-316/matt-martini/README b/challenge-316/matt-martini/README new file mode 100644 index 0000000000..94a7c4ad2e --- /dev/null +++ b/challenge-316/matt-martini/README @@ -0,0 +1 @@ +Solutions by Matt Martini diff --git a/challenge-316/matt-martini/perl/ch-2.pl b/challenge-316/matt-martini/perl/ch-2.pl new file mode 100644 index 0000000000..d1e0013fe3 --- /dev/null +++ b/challenge-316/matt-martini/perl/ch-2.pl @@ -0,0 +1,23 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +# my $str1 = "uvw"; +# my $str2 = "bcudvew"; + +# my $str1 = "aec"; +# my $str2 = "abcde"; + +my $str1 = "sip"; +my $str2 = "javascript"; + +my $str1_prere = join( '.*', unpack( "(a)*", $str1 ) ); +my $str1_re = qr<$str1_prere>; + +if ( $str2 =~ $str1_re ) { + print "true\n"; +} +else { + print "false\n"; +}