Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996804]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2018-05-24 20:44 GMT
Find Nodes?
    Voting Booth?