Re: Perl Object Creation problem...




lawre...@xxxxxxxxxxxxxxxxxxx 寫道:

"howa" <howachen@xxxxxxxxx> writes:

it seems a little stupid if the class name must be the package full
name...


Perhaps this will offer enlightenement:

Suppose I have two classes Road::Apple and Fruit::Apple

#/usr/local/bin/howas-private-perl-like-language
use Road::Apple;
use Fruit::Apple;

my $thing = new Apple;

What kind of apple whould $thing be? One is delicious, the other not
so much.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Lawrence Statton - lawrenabae@xxxxxxxxxxxxx s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
sort them into the correct order.

in other language, you also have this problem, java or c.

in fact, this is not a problem at all, if you want to specifiy, you can
still use the full path if needed.

the namespace and the class name are not the same thing.

.



Relevant Pages

  • Re: Perl Object Creation problem...
    ... it seems a little stupid if the class name must be the package full ... Perhaps this will offer enlightenement: ... What kind of apple whould $thing be? ...
    (comp.lang.perl.misc)
  • Re: Perl Object Creation problem...
    ... it seems a little stupid if the class name must be the package full ... Perhaps this will offer enlightenement: ... What kind of apple whould $thing be? ...
    (comp.lang.perl.misc)
  • Re: Perl Object Creation problem...
    ... it seems a little stupid if the class name must be the package full ... Perhaps this will offer enlightenement: ... What kind of apple whould $thing be? ... Perl does not have that problem. ...
    (comp.lang.perl.misc)