develooper Front page | perl.perl5.porters | Postings from October 2016

[perl #129967] [PATCH] Add @ISA to perlvar

Thread Previous
From:
Tony Cook via RT
Date:
October 31, 2016 00:51
Subject:
[perl #129967] [PATCH] Add @ISA to perlvar
Message ID:
rt-4.0.24-8841-1477875084-347.129967-15-0@perl.org
On Wed Oct 26 02:07:15 2016, haukex@zero-g.net wrote:
> Dear P5Porters,
> 
> I noticed that @ISA isn't documented in perlvar, so I copied & pasted some 
> wordings from other places to make an entry for perlvar.pod, all credit 
> goes to those other PODs I stole from ;-) It's just meant to be a starting 
> point, so I'd be happy to hear any suggestions or changes to the patch.
> 
> Thanks, Regards,
> -- Hauke D

+It is possible to manually set C<@ISA>, but it is recommended to use
+L<parent> to declare parent classes.

Is it recommended?

                                        This pragma will take care of setting
+C<@ISA> and will also load the parent classes and make sure that the
+package doesn't inherit from itself.

Setting @ISA directly also checks for recursive inheritence:

 $ ./perl -e 'package Foo; our @ISA = "Bar"; package Bar; our @ISA = "Foo";'
 Recursive inheritance detected in package 'Bar' at -e line 1.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=129967

Thread Previous


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