develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [patch] small bufgixes

Thread Previous | Thread Next
Benjamin Goldberg
February 26, 2003 22:06
Re: [patch] small bufgixes
Message ID:
Alex Vandiver wrote:
>   Finally, I added a catch so that CODE blocks which are inserted into
> @INC don't get treated as strings.

Coderefs are not the only refs allowed in @INC -- you can put in an
arrayref or a blessed refs, too.

Coderefs get called as $ref->($ref, $file).  Arrayrefs get called as
$ref->[0]->($ref, $file).  Blessed refs get called as $ref->INC($file).

So instead of using 'if UNIVERSAL::isa($path, "CODE")', you should
probably just do 'if ref $path'.

(This is the second time in two weeks that I've seen someone write code
with the believe that coderefs are the only type of ref which can go
into @INC ... I would love to know where this misconception came from.)

$;=qq qJ,krleahciPhueerarsintoitq;sub __{0 &&
my$__;s ee substr$;,$,&&++$__%$,--,1,qq;;;ee;
$__>2&&&__}$,=22+$;=~y yiy y;__ while$;;print

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About