> The {} and [] operators construct new aggregates each time they are evaluated.
This might come as a surprise but literals in Perl are always new as you can see by the references.°
DB<66> p \1
SCALAR(0x335c4a0)
DB<67> p \1
SCALAR(0x335c6f8)
DB<68> p \1
SCALAR(0x335cae8)
DB<69>
I know there are languages where it's always the same (IMHO do Ruby and Lisp have a syntax for this) but this is not what I mean or asked.
Alas ... few of the respondents here seem to have read the code in the OP and really have a deep grasp of aliases.
°) well undef is an exception, but it's debatable if that's a literal or a constant.
DB<69> p \undef
SCALAR(0xfb9098)
DB<70> p \undef
SCALAR(0xfb9098)
DB<71> p \undef
SCALAR(0xfb9098)
DB<72> p \undef
SCALAR(0xfb9098)
DB<73> p \"str"
SCALAR(0x335d3c0)
DB<74> p \"str"
SCALAR(0x335d498)
DB<75> p \"str"
SCALAR(0x335d270)
-
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.
|