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

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

Thread Next
From:
Father Chrysostomos via RT
Date:
October 31, 2016 05:39
Subject:
[perl #129967] [PATCH] Add @ISA to perlvar
Message ID:
rt-4.0.24-1121-1477892346-308.129967-15-0@perl.org
On Sun Oct 30 17:51:24 2016, tonyc wrote:
> 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?

By some and not by others.

> 
> 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.

I think it would be better for perlvar to begin by explaining what the variable does and what it is for, and *then* also mention that parent.pm *can* be used to set it.

-- 

Father Chrysostomos


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

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