Re: RFC 164 (v1) Replace =~, !~, m//, and s/// with match() and subst()
[email protected] (Nathan Torkington)
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <[email protected]> |
Perl6 RFC Librarian writes: > match; # all defaults (pattern is /\w+/?) > match /pat/; # match $_ > match /pat/, $str; # match $str > match /pat/, @strs; # match any of @strs When I was thinking about this very topic yesterday and today, I came up with this problem: @strs = (); match /pat/, @strs; # surprise! I'm matching on $_ That is, how do you tell an empty array from no arguments? I have a horrible suspicion everyone is going to reach for lazy evaluation and other magic. Nat