in reply to Function that accepts both hashes/arrays and hashrefs/arreyrefs

If you're trying to catch argument errors as soon as possible, the simple solution might be to use a prototype of ($), which accepts all but the first two cases and rejects calls that obviously contain other than one argument, and then require users to backslash their hash or array. It also makes myfunc a little simpler because anything that isn't a HASH or ARRAY ref is an error. I don't think the current perl prototype system is flexible enough to do what you want; it basically just hints to the parser what it should be looking for and allows emulation of (most of) the builtin functions.
  • Comment on Re: Function that accepts both hashes/arrays and hashrefs/arreyrefs
  • Download Code