You may also find the following docs useful
http://modernperlbooks.com/books/modern_perl_2016/03-perl-language.html#UGFja2FnZXM
http://modernperlbooks.com/books/modern_perl_2016/07-object-oriented-perl.html#T2JqZWN0cw
(see Moose and Blessed References)
The index of the book is at
On Fri, 4 Aug 2017 17:51:01 +0200
hw wrote:
> Huh? How many package statements is a module supposed to contain?
> And doesn´t a package statement turn a module into a package?
Convention is:
* One package per module.
* One module per package.
But if come across bad code, you
>
> What happens when you bless something in a module?
>
In Perl 5 an object is a reference that has been blessed (with a package
name). The namespace of that package is used to find the methods
associated with the object. If no methods can be found, then the @ISA
package variable is checked to
On Fri, Aug 4, 2017 at 11:52 AM hw wrote:
> > Often you will see a module that contains one package statement which
> leads to the confusion.
>
> Huh? How many package statements is a module supposed to contain?
> And doesn´t a package statement turn a module into a package?
>
Shawn H Corey wrote:
On Fri, 4 Aug 2017 15:23:21 +0200
hw wrote:
Now I´m confused as to what is a module and a package. Both are
files.
> [...]
This is very confusing so the convention is that one module has one
package. I'm telling you this because the terms module and
On 08/04/2017 11:51 AM, hw wrote:
Huh? How many package statements is a module supposed to contain?
And doesn´t a package statement turn a module into a package?
package statements and files are independent!
a package statement only sets the default namespace for code that
follows it until
Chas. Owens wrote:
On Fri, Aug 4, 2017 at 9:25 AM hw > wrote:
snip
Now I´m confused as to what is a module and a package. Both are files.
No, packages are not files. A package is created by a package statement:
package Foo;
This I put into a
Paul Johnson wrote:
On Thu, Aug 03, 2017 at 08:44:45PM +0200, hw wrote:
Hi,
suppose I have a class FOO and a class BAR. The parent of BAR is FOO.
I would like FOO to /use/ BAR because BAR has some methods needed by FOO.
BAR is /decended/ from FOO because FOO has many methods needed by BAR.
On Fri, 4 Aug 2017 15:23:21 +0200
hw wrote:
> Now I´m confused as to what is a module and a package. Both are
> files.
>
> In any case, it is my intention to keep everything that one class
> requires within one file which starts with 'package FOO'. Due to
> increasing
Илья Рассадин wrote:
Hi!
It's strange design decision.
If FOOR is ancestor for BAR, why can't you just place methods into FOO?
It´s because not both of FOO and BAR can have all the same methods. Yet
there is functionality programs using FOO and/or BAR require from both of
them from
On Fri, Aug 4, 2017 at 9:25 AM hw wrote:
snip
> Now I´m confused as to what is a module and a package. Both are files.
>
No, packages are not files. A package is created by a package statement:
package Foo;
If you do not explicitly create a package with a package statement,
Andrew Solomon wrote:
On Thu, Aug 3, 2017 at 8:48 PM, hw > wrote:
Andrew Solomon wrote:
My instinct before trying this would be to move the methods which FOO
needs back into FOO (removing them from BAR).
Is there a reason this won't
Shawn H Corey wrote:
On Thu, 3 Aug 2017 20:44:45 +0200
hw wrote:
Hi,
suppose I have a class FOO and a class BAR. The parent of BAR is FOO.
I would like FOO to /use/ BAR because BAR has some methods needed by
FOO. BAR is /decended/ from FOO because FOO has many methods
On Thu, Aug 03, 2017 at 08:44:45PM +0200, hw wrote:
>
> Hi,
>
> suppose I have a class FOO and a class BAR. The parent of BAR is FOO.
>
> I would like FOO to /use/ BAR because BAR has some methods needed by FOO.
> BAR is /decended/ from FOO because FOO has many methods needed by BAR.
>
> Is
Hi!
It's strange design decision.
If FOOR is ancestor for BAR, why can't you just place methods into FOO?
03.08.17 21:44, hw пишет:
Hi,
suppose I have a class FOO and a class BAR. The parent of BAR is FOO.
I would like FOO to /use/ BAR because BAR has some methods needed by FOO.
BAR is
15 matches
Mail list logo