xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
Below is mentioned in perl6 syn:
As in Perl 5, a module is just a kind of package. Unlike in Perl 5, modules and classes are declared with separate keywords, but they're still just packages with extra behaviors.
To my surprise, That might mean We just say 'use Module' at any time!
Why do I say so?
We must say 'Module ...' if we make own module because we need export symbols. Meanwhile, because module is also a package, we don't need say 'Package ...' to create namespace of module symbols. Furthermore, at any scenes that we need to use package to distinguish symbols(like package variables or package functions), we can simply substitute 'Package ...;' by 'Module ...'.So, Package is just a concept in perl6 but never be used, isn't it?
A superficial thought, I'm looking forward to guru's reply!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Package is useless in Perl6?
by Limbic~Region (Chancellor) on Nov 04, 2008 at 15:15 UTC | |
|
Re: Package is useless in Perl6?
by Anonymous Monk on Nov 04, 2008 at 14:46 UTC | |
by AnomalousMonk (Archbishop) on Nov 04, 2008 at 15:00 UTC | |
by Anonymous Monk on Nov 04, 2008 at 15:18 UTC |