Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi. I'm makng a couple of assumptions, please ignore this post if I'm wrong:

(Update: added OP's <DATA> to make my code stand alone.)

1) The <DATA> snippet that your provided is what you parsed to get your %channel_db_files data structure.

2) 'File numbers' are unique, as in the data you provided.

In which case, I would suggest that you parse your data differently:

my @ordered; while ( <DATA> ) { $ordered[$1] = $2 if /input datafile file number=(\d+) name=(\S+)/ } print "$_\t$ordered[$_]\n" for 1 .. $#ordered; __DATA__ Starting backup at 2011-05-31 02:00:05 channel ch1: starting compressed full datafile backup set channel ch1: specifying datafile(s) in backup set input datafile file number=00010 name=/foo/oradata/bar/foodb-lob01.dbf input datafile file number=00004 name=/foo/oradata/bar/foodb-data02.db +f input datafile file number=00007 name=/foo/oradata/bar/undotbs02.dbf channel ch1: starting piece 1 at 2011-05-31 02:00:06 channel ch2: starting compressed full datafile backup set channel ch2: specifying datafile(s) in backup set input datafile file number=00003 name=/foo/oradata/bar/tools01.dbf input datafile file number=00006 name=/foo/oradata/bar/foodb-index11.d +bf input datafile file number=00002 name=/foo/oradata/bar/undotbs01.dbf channel ch2: starting piece 1 at 2011-05-31 02:00:06 channel ch3: starting compressed full datafile backup set channel ch3: specifying datafile(s) in backup set input datafile file number=00008 name=/foo/oradata/bar/foodb-data01.db +f input datafile file number=00009 name=/foo/oradata/bar/foodb-index01.d +bf input datafile file number=00005 name=/foo/oradata/bar/xml01.dbf input datafile file number=00001 name=/foo/oradata/bar/system01.dbf channel ch3: starting piece 1 at 2011-05-31 02:00:07 channel ch1: finished piece 1 at 2011-05-31 02:34:54 #----------------8<----------------

Ouput:

1 /foo/oradata/bar/system01.dbf 2 /foo/oradata/bar/undotbs01.dbf 3 /foo/oradata/bar/tools01.dbf 4 /foo/oradata/bar/foodb-data02.dbf 5 /foo/oradata/bar/xml01.dbf 6 /foo/oradata/bar/foodb-index11.dbf 7 /foo/oradata/bar/undotbs02.dbf 8 /foo/oradata/bar/foodb-data01.dbf 9 /foo/oradata/bar/foodb-index01.dbf 10 /foo/oradata/bar/foodb-lob01.dbf

In reply to Re: How-to sort nested hash table? by Not_a_Number
in thread How-to sort nested hash table? by Scottie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found