Re: Perl Object Creation problem...
- From: "Brian McCauley" <nobull67@xxxxxxxxx>
- Date: 29 Jun 2006 07:44:25 -0700
howa wrote:
Aukjan van Belkum 寫道:
howa wrote:but is it possible to use
use lib "C:\\temp\\perl";
use class::user;
$u = new user();
----------------------
This should be:
$u = new class::user; (or pref.: my $u = new class::user;)
or
$u = class::user->new(); (or pref.: my $u = class::user->new();)
$u = new user;
just like in c++, i.e. using namespace std;
No, there is no such mechanism builtin[1] to Perl5. All class names
must be specified absolutely.
[1] I say builtin because it's just the sort of thing you might expect
to see in an Acme::* modules. Note Acme::* modules are only intended as
jokes.
.
- Follow-Ups:
- Re: Perl Object Creation problem...
- From: howa
- Re: Perl Object Creation problem...
- References:
- Perl Object Creation problem...
- From: howa
- Re: Perl Object Creation problem...
- From: Aukjan van Belkum
- Re: Perl Object Creation problem...
- From: howa
- Perl Object Creation problem...
- Prev by Date: Re: accessing object variables from callback function
- Next by Date: prematurely closed filehandle
- Previous by thread: Re: Perl Object Creation problem...
- Next by thread: Re: Perl Object Creation problem...
- Index(es):