Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

comment on

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


As others, i will commend your attempting to explore the perl language and learn it better. However, Learning perl through obfuscations is not a very good way to learn perl. This is in particular due to strict and warnings.

When first learning perl it might seem easier to ignore warnings and strict, when in fact this is false laziness. The path to true laziness would learn strict and warnings now so that they are easier to incorporate with knowledge later. With that in mind, if we were to rewrite your node with strict and warnings, we would only need to change code in two places*:

# change @a on first line to: my @a = ("... # change the for loop at the end so that $a is declared: foreach my $a (@a) {print chr(length $a)} # or change the for loop to use $_ instead of $a :) foreach (@a) {print chr length}
A better way to learn (AFAIK) would be to pick up the Llama book and read the chapters followed by doing the examples. To end with, here are some good nodes on learning perl:


* not counting the shebang line and the use strict; lines.

In reply to On exploring Perl by jynx
in thread Another 'ode to backslash' ;-) by Asmo

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
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (2)
    As of 2020-12-03 07:51 GMT
    Find Nodes?
      Voting Booth?
      How often do you use taint mode?

      Results (52 votes). Check out past polls.