develooper Front page | perl.perl5.porters | Postings from April 2001

Re: [PATCH] UNIVERSAL shouldn't require Exporter

Thread Previous | Thread Next
From:
barries
Date:
April 26, 2001 01:54
Subject:
Re: [PATCH] UNIVERSAL shouldn't require Exporter
Message ID:
20010426045417.A28608@jester.slaysys.com
On Thu, Apr 26, 2001 at 07:05:10AM +0100, Graham Barr wrote:
> There should not be an import{} method at all.

Cat's out of the bag on this on, I think.  Quoth perlobj:

     `isa' is also exportable and can be called as a sub with two argu-
     ments. This allows the ability to check what a reference points to.
     Example

	 use UNIVERSAL qw(isa);

	 if(isa($ref, 'ARRAY')) {
	     #...
	 }

It can be handy to be able to call isa() and can() without worrying if
the "object" is blessed.  Why shouldn't isa() be imported, anyway?

- Barrie

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