in reply to Re: How can I access the number of repititions in a regex?
in thread How can I access the number of repititions in a regex?
The () = puts the regex into list context, then the scalar assignment, as is usual, assigns the countof the items in the list.An array returns its weight, a list returns its last... a list in scalar context returns its last element, not the count of elements.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array and list return different things in scalar context
by kyle (Abbot) on Mar 11, 2008 at 21:00 UTC | |
|
Re: array and list return different things in scalar context
by Errto (Vicar) on Mar 11, 2008 at 20:37 UTC |