http://qs321.pair.com?node_id=687029


in reply to Re: Missing ref() return possibility?
in thread Missing ref() return possibility?

What your code implies but isn't quite explicit about is that qr() actually gives back a blessed reference to a scalar.

use Scalar::Util qw/blessed reftype/; my $q = qr//; print 'ref: ', ref($q), "\n"; print 'blessed: ', blessed($q), "\n"; print 'reftype: ', reftype($q), "\n"; __END__ ref: Regexp blessed: Regexp reftype: SCALAR

There's some more about this in How can I tell if an object is based on a regex?