Take a look at
perlrequick. It gives you a quick overview of Regular Expressions in Perl. My explanation of your code is as follows:
- The m tells perl to start a match.
- The | character is used as a delimiter. Using / is normal but any delimiter can be used. If you use / then you don't need to start with an m
- The $input is interpolated (The content of the variable is placed in the regular expression)
- The o modifier signifies that the regular expression is compiled once. Changing the value in $input will not change your regex.
- The whole regular expression is matched against the value held in $_ by default. You would use the =~ operator to match a particular variable.