What I'd like to stress is that in Perl (5, that is!) there's hardly anything like a *string* context
Actually, there is, and lots and lots of it. Perl could not do automatical transformation between numerical values and string values if it wasn't for string context:
Indeed Perl does magic dwimmeries with automatic conversions between numerical and string values depending on how these are used, but what I meant is that only to a very limited extent there does exist a well-definite concept of "string (or numerical) context" comparable to, say, "scalar (or list) context". As an example, quoting from 'perldoc perlvar':
$! If used numerically, yields the current value of the C "errno"
variable, or in other words, if a system or library call fails,
it sets this variable. This means that the value of $! is
meaningful only immediately after a failure:
As you can see, it consistently avoids speaking of "numerical context". Incidentally my stress on Perl5 was due to the fact that Perl6 is supposed to have such contexts instead (and to support them unambiguously!)
Also compare e.g. http://www.google.it/search?q=%22string+context%22+site:perldoc.com
with http://www.google.it/search?q=%22scalar+context%22+site:perldoc.com
-
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.
|