Yes, I'm sorry. I meant *must* return, by my own specification. I know I can return a list, but I think that would make using the function a bit harder, since I usually only need either the path or the file.
That's what complicates the matter; the output depends completely on what name was used to call the function, so if I can't find that out, my implementation is quite useless.
It's something that I would like to see implemented in a new version of Perl, though. I think it would be handy in some cases... More clear to read than anonymous subs.
|