in reply to Re^2: Substring consisting of all the characters until "character X"?
in thread Substring consisting of all the characters until "character X"?

The parentheses provide list context, in which a pattern match returns the captured parts.  In scalar context, the return value is just true/false depending on whether the regex matched.

See perlop.

  • Comment on Re^3: Substring consisting of all the characters until "character X"?

Replies are listed 'Best First'.
Re^4: Substring consisting of all the characters until "character X"?
by davies (Monsignor) on Mar 14, 2011 at 12:50 UTC

    I didn't understand the documentation you pointed me to, but I understood your explanation perfectly! Thanks.

    Regards,

    John Davies