Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> > You need that (...)[0] for the match to return the captures in list context, ( <=> is enforcing scalar context and m// only returns captures in list context otherwise boolean )
see https://perldoc.perl.org/perlop#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, that is, ($1, $2, $3...) (Note that here $1 etc. are also set). 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.
Cheers Rolf In reply to Re^4: How can I sort my array numerically on part of the string? (updated)
by LanX
|
|