p5pclub / ref-util

Ref::Util - Utility functions for checking references
6 stars 11 forks source link

Wishlist: is_ref() function #6

Closed ilmari closed 8 years ago

ilmari commented 8 years ago

Functions often deal with non-refs and some specific type of ref, so being able to write something like this would be nice:

if (!is_ref($foo)) {
    …
}
elsif (is_arrayref($foo)) {
    …
}
else {
    croak "wrong type of foo";
}
xsawyerx commented 8 years ago

Good idea!

xsawyerx commented 8 years ago

Done! Uploaded to CPAN.