comp => sub {
my $rx = shift;
croak "Your pattern is invalid"
- unless $rx->pattern ~~ /pony/;
+ unless $rx->pattern =~ /pony/;
}
);
my ($rx, $str) = @_;
# We always like ponies!
- if ($str ~~ /pony/) {
+ if ($str =~ /pony/) {
$ponies++;
return 1;
}
=head2 str
- "str" ~~ /pattern/;
+ "str" =~ /pattern/;
# in comp/exec/methods:
my $str = $rx->str;
=head2 mod
my %mod = $rx->mod;
- say "has /ix" if %mod ~~ 'i' and %mod ~~ 'x';
+ say "has /ix" if %mod =~ 'i' and %mod =~ 'x';
A key-value pair list of the modifiers the pattern was compiled with.
The keys will zero or more of C<imsxp> and the values will be true
my ($re, $paren) = @_;
# This is perl's engine doing the match
- $str ~~ /(.*)/;
+ $str =~ /(.*)/;
# $1 has been untainted
return $1;
comp => sub { die "died at comp time" },
);
-eval { "str" ~~ /noes/ };
+eval { "str" =~ /noes/ };
TODO: {
local $TODO = 'passing tests for known bug with how we handle eval';