NAME

Scalar::RefType - Perl extension for getting the reftype of a scalar ref

SYNOPSIS

use Scalar::RefType;
my $x = \1;
my $y = ['a' .. 'z'];
my $z = { a => 1, b => 2};

ok(sref($x),"scalar ref");
ok(aref($y),"array ref");
ok(href($z),"hash ref");

DESCRIPTION

Perl extension for getting the reftype of a scalar ref. given a ref, it is easy to use sref, aref, href to know the ref type

EXPORT

sref

accept one and only one argument
return true if the arg is a scalar ref

aref

accept one and only one argument
return true if the arg is a array ref

href

accept one and only one argument
return true if the arg is a hash ref

AUTHOR

Hao Wu <echowuhao@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Hao Wu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.0 or, at your option, any later version of Perl 5 you may have available.