more useful options | |
PerlMonks |
Why are my functions second-class citizens?by geary@acm.org (Initiate) |
on Feb 15, 2012 at 16:30 UTC ( [id://953996]=perlquestion: print w/replies, xml ) | Need Help?? |
geary@acm.org has asked for the wisdom of the Perl Monks concerning the following question: So, let's say, purely for the sake of argument, that I have a function like: and I want to call it in this context: Perl won't let me because it thinks I'm trying to use &rv as the comparison function for sort. I could say: but that doesn't look as cool. This works: How do get perl to treat &rv the same way? ======= (added in 2019) This has been sitting at the back of my mind for the past seven years, and I have finally come back to it. I wasn't clear in my original question on what I wanted to know, and as a result all the answers missed the point. I don't want to put any of the code above in a program. I want to understand why this difference exists.
Back to
Seekers of Perl Wisdom
|
|