Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: My first perl script is working, what did I do wrong?

by space_monk (Chaplain)
on Nov 09, 2012 at 01:40 UTC ( #1003044=note: print w/ replies, xml ) Need Help??

in reply to My first perl script is working, what did I do wrong?

First, its a good idea to seek advice and review. I regularly write stuff that I think is good until one of my colleagues points out that he would have done it better/ faster/ in less code by doing it another way.... :-)

Second, the main mistake you made is that you didn't ask yourself what tasks in the above script could be done by standard PERL libraries instead of lovingly hand crafting every aspect. There are lots of text parsing libraries, which if used, would have the benefit of substantially simplifying your code.

In future, spend a few minutes before commencing any programming task, asking yourself what someone is likely to have done before, and what you can borrow from others to simplify your task and to make your code more understandable and maintainable.

A quick browse of CPAN or PerlMonks before you program will often save someone dissecting where you went wrong afterwards. That said, good luck in the future! :-)

A Monk aims to give answers to those who have none, and to learn from those who know more.

Comment on Re: My first perl script is working, what did I do wrong?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003044]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-10-01 09:21 GMT
Find Nodes?
    Voting Booth?

    How do you remember the number of days in each month?

    Results (392 votes), past polls