Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How can I sort this array?

by dws (Chancellor)
on Jun 17, 2002 at 17:32 UTC ( #175141=note: print w/replies, xml ) Need Help??


in reply to How can I sort this array?

To get these to sort, you're going to need to extract/construct a key you can sort on. Since the files are named like   Order_29May11:05.bak
You can extract some sortable pieces by doing
$name =~ s/_(\d\d)(...)(\d\d:\d\d)/; $key = $month{$2} . $1 . $3;
where %month is a hash that maps the 3 character month abbreviation to a to character numeric string (e.g., 'Jan' => '01', ... 'Dec' => '12').

You can use this within a Schwartzian transform (many examples of which can be found by doing a Super Search on "Schwartzian").

Replies are listed 'Best First'.
Re^2: How can I sort this array?
by particle (Vicar) on Jun 17, 2002 at 19:12 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://175141]
help
Chatterbox?
[erix]: I'd just try <a id="header text on page"></a>
[LanX]: yep
[erix]: or Ctrl-U to view current html :P
[LanX]: name not id
[LanX]: id isn't approved AFAIK
[LanX]: name works
erix feels silly for having actually tested that contiguous values make no difference in CLUSTERing a table (At least, in postges)
[LanX]: Perl Monks Approved HTML tags
[LanX]: erix and his postguess ...
[erix]: (Grrres...)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-06-24 13:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (557 votes). Check out past polls.