* Steve Fink sph...@gmail.com [2012-05-18 10:25]:
On Thu, May 17, 2012 at 3:14 AM, Aristotle Pagaltzis pagalt...@gmx.de wrote:
* Mike Erickson m...@quidquam.com [2012-05-16 15:45]:
If you don't care about order, but just want those elements, you
can also do:
keys
use `values` these problems go away… except that to get the odd-
index elements from it you have to `reverse` the array, at which point
a not-especially-golfed grep is shorter.
--
*AUTOLOAD=*_;sub _{s/$/$/;s/(.*):://;wantarray//substr$_,-1,1,,$/;print;$1}
Just-another-Perl-hack;
#Aristotle Pagaltzis
for doing
half as much work. (For even elements, the map and grep solutions would
yield exactly equally long code, with half-as-much-work still applying.)
--
*AUTOLOAD=*_;sub _{s/$/$/;s/(.*):://;wantarray//substr$_,-1,1,,$/;print;$1}
Just-another-Perl-hack;
#Aristotle Pagaltzis // http
* Ronald J Kimball rjk-perl-...@tamias.net [2011-11-16 21:50]:
It is greedy, but the important thing to remember is that the regular
expression engine will find the longest *leftmost* match.
To put that a third way: the engine will match at the first possible
location, and will make the match
] with
an ISO-8859 charset) in the same document.
[1]: Well, Modern Greek anyway.
Regards,
--
Aristotle Pagaltzis // http://plasmasturm.org/