As
Nikhil Jain and
toolic have said, named parameters are a great way to go. On the other hand, since I'm a C++ programming by trade, I'm inclined to just put the optional parameters at the end of the list instead of in the middle. That way you only have to check if they are
undef and clients don't have to worry about putting in placeholders.