in reply to Thoughts on "one function, flexible arguments"?

The real issue is kind of semipredicate problem, which is avoided in your special example but can't be in general.

So what happens if the first positional argument is a hash ref and not a string like in your case?

How can you tell that this ref doesn't represent a hash of named arguments?

If this happens you'd need to diverge from your interface standard and will confuse yourself and your users.

Better stick with a convention which doesn't need special cases.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re: Thoughts on "one function, flexible arguments"?