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

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

Thread Previous
Tony Cook via RT
October 31, 2016 00:51
[perl #129967] [PATCH] Add @ISA to perlvar
Message ID:
On Wed Oct 26 02:07:15 2016, 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.


via perlbug:  queue: perl5 status: new

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