develooper Front page | perl.perl5.porters | Postings from August 2010

Re: Mutually dependent classes

Thread Previous | Thread Next
From:
Eric Brine
Date:
August 5, 2010 07:54
Subject:
Re: Mutually dependent classes
Message ID:
AANLkTik+BZDbyGFQpQ0dyvCBf_iN0WpNLn23Y3Nf2kNO@mail.gmail.com
On Wed, Aug 4, 2010 at 8:21 PM, Mark J. Reed <markjreed@gmail.com> wrote:

> Dumb question maybe, but if I have two classes which need to call
> methods on each other's objects, how can I define them without getting
> 'redefined subroutine' warnings (and possibly assorted other
> circular-reference problems)?
>


Your code does not emit such warnings.

>perl -we"use Parent; use Child;"

>perl -we"use Child; use Parent;"

>

p5p is for development of Perl itself. Please direct future help questions
to htttp://www.perlmonks.org/

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