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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top