develooper Front page | perl.perl5.porters | Postings from January 2009

Re: [PATCH] Re: [PATCH] File::Copy & permission bits.

Thread Previous | Thread Next
From:
demerphq
Date:
January 28, 2009 14:47
Subject:
Re: [PATCH] Re: [PATCH] File::Copy & permission bits.
Message ID:
9b18b3110901281446l424b7da2s22a9efd2214da4de@mail.gmail.com
2009/1/28 Aristotle Pagaltzis <pagaltzis@gmx.de>:
> * chromatic <chromatic@wgz.org> [2009-01-27 20:55]:
>> Nitpicking:
>>
>>   use Test::More tests => 1;
>>
>>   sub blessed {
>>       my $var = shift;
>>       return UNIVERSAL::can($var, 'can') && ref($var);
>>   }
>>
>>   ok( ! blessed( qr// ), 'compiled regexp is not blessed' );
>
> Nitpicking:
>
>    use Test::More tests => 1;
>    use Scalar::Util 'blessed';
>
>    ok( ! blessed( qr// ), 'compiled regexp is not blessed' );
>
> Freaky, though:
>
>    $ perl -le'print qr//->can('can')'
>    CODE(0x814cee8)
>
> Heh.

I dont get the joke. qr// returns a blessed reference.

So what does the nitpicking prove?

perl -le'print qr//->can("can"); print UNIVERSAL->can("can")'
CODE(0x8153ed4)
CODE(0x8153ed4)

No big surprise here.

Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About