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.
[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.
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.
[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.
$h{$i, $j, ...} is equivalent to $h{join($;, $i, $j, ...)}.
*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).
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|