in reply to Lady_TM
The prototypes on all of your subroutines conflict with the code in the subroutines. For example: sub new ($){ says that new takes a single argument, but then two arguments are shifted from @_:
It is fortunate in this case that current versions of Perl ignore prototypes on method calls. :)my $self = shift; $self = bless {}; $self{'index_path'} = shift;
Your hardcoded LOCK constants are not platform compatible:
The constants from Fcntl should be used instead.$LOCK_SH = '1'; $LOCK_EX = '2'; $LOCK_NB = '3'; $LOCK_UN = '4';
Globs, which are entries in the symbol table, do not include lexical variables, which are held outside the symbol table. In this code:
the glob that is returned does not include the lexical hash that was just made. You probably want to return the hash itself, or a reference to it.my %deleted_pair = (); $deleted_pair{$key} = $TABLE{$key}; delete ($TABLE{$key}); $self->update_index_table(\%TABLE); return (*deleted_pair)
These are a few of the more egregious issues with the current state of your module. I hope you will continue making improvements.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Lady_TM
by Steeeeeve (Initiate) on Feb 02, 2001 at 02:58 UTC | |
|
Re: Re: Lady_TM
by Steeeeeve (Initiate) on Feb 04, 2001 at 09:59 UTC | |
|
Re: Re: Lady_TM
by Steeeeeve (Initiate) on Feb 02, 2001 at 03:48 UTC | |
by tilly (Archbishop) on Feb 04, 2001 at 11:58 UTC | |
by Steeeeeve (Initiate) on Feb 05, 2001 at 09:40 UTC | |
|