Shawn,
If there is one thing you might take to heart I say it should be passing lists and hashes, a generaly more sophisticated way of going about things.
No, I did not mean to suggest you use globals.
The best analogy for functional programming is to imagine a production line with people all working a product that gets
passed along. If you imagine each person is a suboutine/function then they get 'passed' some stuff, and they 'pass back/along' what they have done.
What you are saying is...
Bob, here's the spanner,
Bob, heres the screwdriver,
Bob, heres the hammer...
Instead of just passing Bob the whole toolkit.
If you pack all the items you want into a list, and pass
the function a reference to that list, you effectively pass the whole bunch of stuff in one go.
Of course the codes not bad, I jest. I've seen some _real_ horror in my time, if anything I see indications that you're a good coder limited by a few hangups. It's no worse than my perl code from not too long ago.
Initially I thought you had not written the code yourself,
and it was a cut n paste from a scripts site, but once I read it I realised you were struggling.
I also see your background is in C, the move to Perl asks that you 'unlearn' some stuff. It's very forgiving too, and what looks syntactically nice to a C hacker is sometimes ugly in Perl.
If you don't already have it I strongly recommend the Ram Book (cookbook), meshes perfectly with your level and need for practical snippets.
have fun
Andy | [reply] |