1. Looks safe because it looks like a comment is being evaluated, but what if $nada contained a newline? If text is being inserted in to code without first being converted into code, you have a code injection bug.

  2. [See (6) first] _ refers to *_, the glob (symbol table entry) that contains $_, @_, etc. Here, it's used as a file handle, presumably populated by an earlier stat or -X operator.

  3. s/// returns true if it matched, so this code repeatedly performs the substitution until it doesn't match. This pattern is usually buggy. Replacing the whole with a single s///eg will solve these bugs.

  4. [See (6) first] Creates a lexical variable named $a and aliases $_ to it until the end of the current lexical scope. Note that creating a lexical named $a will cause problems for sort and similar functions.

  5. $h{$i, $j, ...} is equivalent to $h{join($;, $i, $j, ...)}.

  6. *name is a typeglob, or just glob for short. Globs are used as the entries of the symbol table, so a glob is a struct with a slot for each type of variable (scalar, array, hash, glob, code) and few others (file handle, directory handle, format). I could be missing some. One might say it's a bunch of variables of different types, perhaps even a glob of types... Globs are weird because they are both a type of variable (e.g. *foo) and a type of scalar (e.g. $foo = *foo;).

Update: Added missing answer for (6).


In reply to Re: unknown code by ikegami
in thread unknown code by MurciaNew

Title:
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, details, 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, summary, 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.