Because you did not RTF M :)
reverse LIST
In list context, returns a list value consisting of the elemen
+ts
of LIST in the opposite order. In scalar context, concatenates
the elements of LIST and returns a string value with all
characters in the opposite order.
print reverse <>; # line tac, last line first
undef $/; # for efficiency of <>
print scalar reverse <>; # character tac, last line tsr
+if
Used without arguments in scalar context, reverse() reverses $
+_.
This operator is also handy for inverting a hash, although the
+re
are some caveats. If a value is duplicated in the original has
+h,
only one of those can be represented as a key in the inverted
hash. Also, this has to unwind one hash and build a whole new
one, which may take some time on a large hash, such as from a
DBM file.
%by_name = reverse %by_address; # Invert the hash
-
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.
|