Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Being more Assert-ive with Perl

by ysth (Canon)
on Sep 19, 2004 at 03:26 UTC ( [id://392097]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Being more Assert-ive with Perl
in thread Being more Assert-ive with Perl

The only real solution to this problem is to see if you can use something as the type of ref you want:
sub hashref { eval { \%{$_[0]} } } sub myfunc { hashref($_[0]) or die "myfunc expected a hashref"; }
reftype won't handle all cases (e.g. deref-overloading or perl4-style glob passing).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://392097]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-28 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found