Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: new to perl, need some help

by marquezc329 (Scribe)
on Oct 02, 2012 at 06:20 UTC ( #996804=note: print w/ replies, xml ) Need Help??


in reply to new to perl, need some help

Hi! I'm still pretty new to Perl/PerlMonks as well, but I'd really recommend taking a look at perldebtut in the documentation. It talks about why you should start with

use strict; use warnings;
as NetWallah recommended. Also, you will learn how to use the Perl debugger to step through one line of code at a time and really get a chance to watch as all the action happens. Like I said I'm still fairly new and learning more everyday, but stopping for frequent trips to the debugger to examine loops/conditionals, and especially as I learn to build more complex data stuctures, has not only helped me tremendously in writing working code and solving problems myself, but in UNDERSTANDING not only why certain pieces of code don't work, but often more importantly, why they do work. I'd take a look at the tutorial and then try to use the original code you posted to practice. I'll bet you can see exactly where @values reinitializes/empties on each round through the loop. Good Luck!


Comment on Re: new to perl, need some help
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-11-29 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls