"4) sort the higest one "
Sort the highest one what?
Do you mean:
- sort by bitsin?
- sort by bitsout?
- extract the highest bitsin value?
- extract the highest bitsout value?
- something else entirely?
You need to clarify.
By the way, the "sorting by date" that you've implemented does not work. If you enable warnings, you will see the following output:
Argument "12/6/2006 00:07:22" isn't numeric in numeric comparison (<=>
+) at foo.pl line 15, <DATA> line 4.
Argument "12/6/2006 00:02:23" isn't numeric in numeric comparison (<=>
+) at foo.pl line 15, <DATA> line 4.
Argument "12/6/2006 00:17:23" isn't numeric in numeric comparison (<=>
+) at foo.pl line 15, <DATA> line 4.
Argument "12/6/2006 00:12:22" isn't numeric in numeric comparison (<=>
+) at foo.pl line 15, <DATA> line 4.
You get that because you are tring to do a numeric sort on "stringified" data. To properly sort by date, you'll need to first convert the strings into something that sort can make sense of. For example, a unix timestamp. Something like Date::Manip or Date::Calc will be useful for that.
Cheers,
Darren
-
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.
|