Parrot Perl 6 regexes #12

Performing a match

Matches in Perl 6 use the ~~ operator:

if $line ~~ /perl/ {
    say "You're using a good language";
}

Negative matches use the !~~ operator:

if $line !~~ /perl/ {
    say "Maybe you should switch to Perl";
}
Copyright © 2009
http://www.pmichaud.com/2009/pres/