Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Usually people fall into two categories: visual learners and oral learners. You might be in the second category, in which case it could help to find a local perl course (usually not available) or someone with perl knowledge to talk to (chances pretty good). At least if you are in or near a bigger city you should be able to find a perl user group (for example "perl mongers"). Whether you get someone to help you is dependant on your social skills ;-)

Independent from that the best way to learn any programming language is to write small programs yourself, as previous posters already mentioned. But for that one important piece of knowledge (that beginner books strangly never seem to impart) is how to debug. It is rather trivial knowledge, but most things are after you know them. And while debugging you learn the most about a language

When you write programs, even really small ones, you will produce bugs and your program will produce surprising output. If it is a syntax error it is easy, just read the error message for hints where to look. But if your program just does something strange or loops endlessly or just hangs, what do you do?

Simple, you check what your program is doing in detail by adding print statements. Statements like print "start of loop 1\n" will tell you the order in which your program is executed. Statements like print "counter is $counter\n" will tell you the contents of variables at critical points in your program. Don't assume anything, check what you believe to know

Perl can help you with debugging. Always write "use warnings;" and "use strict;" at the start of your scripts. Strict mode may seem like a hassle (basically you have to declare every variable with 'my' the first time you use it), but it is worth it in the long run.

If you further add "use Data::Dumper;" you can always print out variable values with print Dumper(\$counter); in much more detail, very helpful with arrays and hashes.

In reply to Re: Best ways of learning Perl! by jethro
in thread Best ways of learning Perl! by Tea

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [erix]: why does that matter?
    [holli]: "die Kleine" is a (somewhat diminishing) term for woman :) also someone at stock overflow seems to think i'm female
    [Discipulus]: holli orange is gold in the morning, silver in afternoon and lead in the nigth..
    [Discipulus]: banana too better not in the night
    [holli]: it actually feels more like a lead-acid battery ^^
    [Discipulus]: erix are you now travelling in space? iirc you were in low countries
    choroba had 4 beers (or was it 5?) yesterday, plus a pickled cheese
    [choroba]: megalag :-(

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (6)
    As of 2017-11-22 09:03 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (316 votes). Check out past polls.