DavidSzczesniak
12/4/2017 - 12:07 PM

Binding operator

Tells Perl to match the pattern on th right against the string on the left, instead of matching against $_.

\!h # Simple example using the binding operator which helps find the word "success".

my $word = "success";
# Here =~ is the binding operator
if($word =~ m/success/) { # 'm/success/' is the matching operator, 'm' stands for matching
  print "Found success!\n";
} else {
  print "Did not find success\n";  
}