What is the meaning of the vertical bar when used with m?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Akino877
    New Member
    • Nov 2007
    • 37

    What is the meaning of the vertical bar when used with m?

    Hello,

    I am trying to understand the following line of Perl code :

    Code:
    ($a_month, $a_day, $a_year) = $a =~ m|(\d\d?)/(\d\d?)/(\d{4})|;
    I understand that the end result is that $a_month will get 1 or more digits; $a_day will get one or more digits; and $a_year will get 4 digits. But I would like to understand the meaning of 'm' and the vertical bars in this context.

    Could someone please help me?

    Thank you - Akino
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    It's documented in perldoc perlre

    Comment

    Working...