Advice on converting hashed packages to pseudo-hashed packages


I

Ian

Does a document exist with the outline below? If so please point me to
it... If not, any help would be appreciated:

"So, you wrote some object-oriented perl packages and you used hashes
for all your objects because your boss wanted results and you stopped
reading at page 125 of Conway. Now you found that your code runs
horribly slowly and you should have used pseudo-hashes and the 'fields'
pragma, but it looks like there's a lot to learn, and you're nervous
about trying to convert this code. Here's what to do, and the things
you need to watch out for:"

Thanks in advance,
Ian.
 
Ad

Advertisements

A

Arndt Jonasson

Ian said:
Does a document exist with the outline below? If so please point me to
it... If not, any help would be appreciated:

"So, you wrote some object-oriented perl packages and you used hashes
for all your objects because your boss wanted results and you stopped
reading at page 125 of Conway. Now you found that your code runs
horribly slowly and you should have used pseudo-hashes and the 'fields'
pragma, but it looks like there's a lot to learn, and you're nervous
about trying to convert this code. Here's what to do, and the things
you need to watch out for:"

I don't know, but the text below (from perldiag) would rather make me
nervous if I had used pseudo-hashes (thanks for giving me an
opportunity to learn what they are):

=item Pseudo-hashes are deprecated

(D deprecated) Pseudo-hashes were deprecated in Perl 5.8.0 and they
will be removed in Perl 5.10.0, see L<perl58delta> for more details.
You can continue to use the C<fields> pragma.
 
I

Ian

<gulp> ... Thanks for the warning! It is a bit worrying that I was
about to "upgrade" to a deprecated feature. I hope that I can
future-proof the code under 5.6.1 as well as speed it up. I'm using
perl 5.6.1 because it's the only one supported at my site. I hope there
will be a new edition of Conway's "Object Oriented Perl" if there isn't
one already. - Regards, Ian.
 
Ad

Advertisements

X

xhoster

Ian said:
<gulp> ... Thanks for the warning! It is a bit worrying that I was
about to "upgrade" to a deprecated feature. I hope that I can
future-proof the code under 5.6.1 as well as speed it up. I'm using
perl 5.6.1 because it's the only one supported at my site. I hope there
will be a new edition of Conway's "Object Oriented Perl" if there isn't
one already. - Regards, Ian.

They probably wouldn't have speeded your program up noticably anyway.
Have you profiled it to see where it spends its time?

Xho
 

Top