Thank you Ken. For wantarray, it's exactly answer what I want. I also tried a test.pl verify it.
I understand PUSH and SET after reading your comments. My another question is about the reason of using the ++. If the 0(false) is added to 1, what's the incrementing for? It's not like an iterator's or a pointer's moving we normally see. The increasing didn't change anything seemingly.
For "++" sign in Perl, I only use it in some simple cases and seldom embedded it into a complicated expression. In some language, "++"'s action is dependent on the compiler's implementation and I should know the language very well or may easily make error. When I saw "$seen{lc($field)}++", I'm thinking which operator wll take the highest priority to interpreter, "($seen{lc($field)})++" or "$seen({lc($field)}++)". I decided to find some artical about Perl Ops priority to read first.
-
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.
|