Thread Klammerausdrücke $1, $2 zu [0], [1] usw. (9 answers)
Opened by rosti at 2012-05-24 18:17

moritz
 2012-05-24 18:30
#158579 #158579
User since
2007-05-11
923 Artikel
HausmeisterIn
[Homepage]
user image
Weil du nicht genug perldoc liest. Aus perlop:

Quote
Matching in list context
If the "/g" option is not used, "m//" in list context returns a list consisting of the subexpressions matched by the parentheses in the pattern, i.e., ($1, $2, $3...). (Note that here $1 etc. are also set, and that this differs from Perl 4's behavior.) When there are no parentheses in the pattern, the return value is the list "(1)" for success. With or without parentheses, an empty list is returned upon failure.

View full thread Klammerausdrücke $1, $2 zu [0], [1] usw.