Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading data dumper output 1

Status
Not open for further replies.

kevin197

Programmer
Mar 21, 2002
88
GB
I've got a output from data dumper of

$VAR1 = [ [ 'a', 'href', '/amtu/production/reports/' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER82701764.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER82748444.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER82784564.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER82822204.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER82918444.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER82979644.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83007424.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83071184.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83102664.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83135504.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83278844.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83370124.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83403464.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER83442784.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84190704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84240024.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84288524.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84330384.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84371964.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84499384.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84549404.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84603504.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84657624.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84711704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER84796284.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85056704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85107504.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85160424.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85203664.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85239624.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85278224.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85303704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85361604.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85534844.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85584544.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85623584.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85695044.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85827084.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85958744.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER85991984.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86027584.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86049124.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86175884.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86240084.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86270804.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86304224.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86365124.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86379984.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86497884.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86595244.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86646704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86693544.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86732884.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86776604.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER86952184.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87002564.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87053784.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87108284.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87150704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87253544.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87542364.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87588784.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87674364.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87851964.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87905964.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER87958384.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88014624.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88060444.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88145504.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88174224.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88209724.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88328484.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88481924.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88524504.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88562404.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88596084.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88827264.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER88859344.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89075184.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89106024.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89170024.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89245844.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89468224.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89522204.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89582464.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89636724.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89682704.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89731124.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER89905384.xml' ], [ 'a', 'href', '/amtu/production/reports/old_reports/ORDER90013604.xml' ] ];

How would I get /amtu/production/reports/old_reports/ORDER82701764.xml on it's own?

Last time I pulled in this format

$VAR1 = { 'xmlns:xsi' => ' 'Message' => [ { 'MessageID' => [ '1' ], etc...

I could read that using

print $ref->{Message}[$customerkey]->{OrderReport}[0]->{AmazonOrderID}[0];

As the new data doesn't use {}'s does that mean the data is in arrays and not a hash?
 
Looks like an array of arrays
Code:
print $ref->[$i]->[$j];

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
I thought it was just arrays but wanted to check, thanks.

So if I wanted to print /amtu/production/reports/old_reports/ORDER82701764.xml

Then what would it be?

print $ref->.......

I know that something will be[2] as I think the url is the 3rd thing in one of the arrays.

Could you give me a example to just print /amtu/production/reports/old_reports/ORDER82701764.xml please?
 
Code:
print $ref->[1]->[2];

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
If you don't know where the data you want is in the array stack you have to loop through and search for it, but if you know it is the second element the code Steve posted will work.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Thanks to both of you. It's working now with

print @links->[1]->[2];

Now I can use a counter and pull all the links to work with :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top