Michael Fowler wrote:

>      Tearing out the pseudohash code gives an across the board 10-15%
>      gain in speed in basic benchmarks. That means if we didn't have
>      pseudohashes, normal hashes would be just as fast as fully declared
>      pseudohashes!
> 
> So don't mourn their passing.

But there is another good thing about the pseudo-hashes: their
usage together with "use fields" like in:

use fields qw ( receive transmit );

sub new
  {
  my $proto = shift;
  my $class = ref($proto) || $proto;

  no strict "refs";
  my MyClass $self = [ \%{"${class}::FIELDS"}];

...

The pseudo-hashes have no autovivification - therefore
$self->{recieve} will result in an error. When using
hashes, the new hash entry is created without my knowledge.

Maybe that is not a problem when you are using a sophisticated
IDE that knows your classes and the fields that you would
like to use ... but for example my IDE is called 
X (http://www.interlog.com/~bwt/x2main.htm) and not that smart ;-(

And typing "recieve" instead of "receive" might happen
quite often and will then lead to very-hard-to-find bugs ...

And as far as I understand there is no way to avoid this 
behaviour when using hashes.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to