in reply to How to differentiate hash reference and object reference?

For fucks sake, just use Params::Validate!

sub wants_foo_object { my ( $foo ) = validate_pos( @_, { class => 'foo' } ); .... }

Replies are listed 'Best First'.
Re^2: How to differentiate hash reference and object reference?
by xdg (Monsignor) on Aug 31, 2005 at 14:32 UTC

    Ordinarily, I'd have voted ++ for suggesting Params::Validate, but -- for unnecessary profanity. That's not what I want to see on this site.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      That's not what I want to see on this site.
      And it's absolutely not what we are used to from diotalevi. I wonder what has bitten him.


      holli, /regexed monk/