[Columbus-pm] perl question

Mark Geary geary at prismnet.com
Mon Feb 13 09:18:24 PST 2012


So, I've got this function that returns a list and I want to sort the
returned list:

    sub rv (@) { reverse @_; }
    sort rv @list;

but perl thinks I want to use rv as the sort comparison function. If I say:

    sort reverse @list;

then perl knows what I want to do. How do I make the first statement
work without adding lots of parentheses?

Mark Geary


More information about the Columbus-pm mailing list