G'day jnoirel,
Welcome to the Monastery.
Note: this response is solely about your intended usage.
I'm trying to develop a package DATASTORE used like this
$D = new DATASTORE 'dir', 'filename';
That's called Indirect Object Syntax and, if you follow that link, you'll see:
"Outside of the file handle case, use of this syntax is discouraged as it can confuse the Perl interpreter. See below for more details."
The section right above that, Invoking Class Methods, has additional useful information.
Of lesser concern, but worth considering, is the class name DATASTORE. Tokens in all uppercase are typically either reserved words (e.g. SUPER, AUTOLOAD, etc.) or constants (e.g. use constant XXX => 1;). The choice is entirely up to you; my choice would probably be Datastore.
Putting all that together, usage might look more like:
my $datastore = Datastore::->new('dir', 'filename');
-- Ken
In reply to Re: Inherit methods from IO::File and IO::Uncompress depending on file extension
by kcott
in thread Inherit methods from IO::File and IO::Uncompress depending on file extension
by jnoirel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |