use Moose::Deprecated;
use Scalar::Util 'blessed', 'looks_like_number';
- our $VERSION = '1.9900';
- $VERSION = eval $VERSION;
- our $AUTHORITY = 'cpan:STEVAN';
-
sub Value { defined($_[0]) && !ref($_[0]) }
sub Ref { ref($_[0]) }
-# We need to use a temporary here to flatten LVALUEs, for instance as in
+# We might need to use a temporary here to flatten LVALUEs, for instance as in
# Str(substr($_,0,255)).
sub Str {
- my $value = $_[0];
- defined($value) && ref(\$value) eq 'SCALAR'
+ defined($_[0])
+ && ( ref(\ $_[0] ) eq 'SCALAR'
+ || ref(\(my $value = $_[0])) eq 'SCALAR')
}
sub Num { !ref($_[0]) && looks_like_number($_[0]) }
See L<Moose/BUGS> for details on reporting bugs.
- =head1 AUTHOR
-
- Yuval Kogman E<lt>nothingmuch@cpan.orgE<gt>
-
- =head1 COPYRIGHT AND LICENSE
-
- Copyright 2007-2010 by Infinity Interactive, Inc.
-
- L<http://www.iinteractive.com>
-
- This library is free software; you can redistribute it and/or modify
- it under the same terms as Perl itself.
-
=cut