Hello,

Aaron Sherman wrote:
> I was thinking about the case where you use a module, only to define a
> class that you then instantiate like this:
[ snip ]
> So, I was wondering about a synonym, like:
> 
> uses Some::Module::That::Defines::A::Class $foo;

is $foo implicitely declared as our or my (or state or temp)?

IMHO it'd be better to be explicit:
    my  $foo = uses Some::Module::That::Defines::A::Class;
    our $bar = uses Some::Module::That::Defines::A::Class;

Or, requiring C<use> to return it's first argument (IIRC a Class object):
    my  $qux = use(Some::Module::That::Defines::A::Class).new(...);

If C<use>'s argument is a Module object, C<use> should return the first
class of that module.

I like the C<use(...).new(...)> form the best, because it allows you to pass
parameters to C<new>.


Ingo Blechschmidt

-- 
Linux, the choice of a GNU | Running Windows on a Pentium is like having
generation on a dual AMD-  | a brand new Porsche but only be able to
Athlon!                    | drive backwards with the handbrake on.
Encrypted mails preferred. | (Unknown source)  

Reply via email to