473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Understanding a hashref

8
Hi,.

Newbie dumb question time ! Could somebody either give me an iniots guide to hashrefs or point me in the direction of one ? I can not get my head around the structure.

I have sucked in an XML file using XML::Simple and can dump the data quite nicely to screen as per the following

Expand|Select|Wrap|Line Numbers
  1. $VAR1 = {
  2.     'ORDER' => [
  3.         {
  4.             'ORDER_NUMBER' => 'W-21670-3',
  5.             'DETAILS' => {
  6.                 'LOCATION' => 'WGBASLBA',
  7.                 'DATE' => '07/05/2006 12:30:19',
  8.                 'VENDOR_REF' => 'FI15374820 KNCL1023',
  9.                 'TYPE' => {},
  10.                 'MOD_LEVEL' => 'EQU-INSTL-CPE',
  11.                 'PART_NUMBER' => 'CIS-CAB-ETH-S-RJ45',
  12.                 'DOMAIN' => 'Equant Non-serialized',
  13.                 'SHIPPED_QTY' => '2',
  14.                 'SERIAL_NO' => {}
  15.             }
  16.         },
  17.         {
  18.             'ORDER_NUMBER' => 'W-21670-4',
  19.             'DETAILS' => {
  20.                 'LOCATION' => 'WGBASLBA',
  21.                 'DATE' => '07/05/2006 12:31:25',
  22.                 'VENDOR_REF' => 'FI15374820 KNCL1023',
  23.                 'TYPE' => {},
  24.                 'MOD_LEVEL' => 'EQU-INSTL-ZFS',
  25.                 'PART_NUMBER' => 'SVP-CAB-RJ45-X',
  26.                 'DOMAIN' => 'Equant Non-serialized',
  27.                 'SHIPPED_QTY' => '1',
  28.                 'SERIAL_NO' => {}
  29.             }
  30.         },
  31.         {
  32.             'ORDER_NUMBER' => 'W-11206-1',
  33.             'DETAILS' => {
  34.                 'LOCATION' => 'WGBASMAN',
  35.                 'DATE' => '03/02/2006 10:35:05',
  36.                 'VENDOR_REF' => 'PMAN354 FI14162655',
  37.                 'TYPE' => {},
  38.                 'MOD_LEVEL' => 'EQU-INSTL-CPE',
  39.                 'PART_NUMBER' => 'CIS-CISCO2610XM',
  40.                 'DOMAIN' => 'Equant Serialized',
  41.                 'SHIPPED_QTY' => '1',
  42.                 'SERIAL_NO' => ' FCZ095071BE'
  43.             }
  44.         }
  45.     ]
  46. };
  47.  
I am having difficulty just starting to extract the data from the hashref now !
I want to be able to convert this data to a simple CSV output. - that bit I can do no problem if I just had the data available to me in standard scalars.

I guess my qwuestion is how to start to reference this data from within the script ?

Many Thanks

Keith
Jun 18 '07 #1
3 1668
KevinADC
4,059 Expert 2GB
check out the first two tutorials on this page:

http://perldoc.perl.org/index-tutorials.html
Jun 18 '07 #2
keithl
8
Thanks Kevin,

That looks like exactly the kind of guide I've been searching for all day !!

Keith
Jun 18 '07 #3
KevinADC
4,059 Expert 2GB
yer welcome Keith ....
Jun 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike | last post by:
Hey guys, need some help understanding some things that maybe someone can explain or clarify it a little better then a text book. Here is my understanding so far: Class - basically a shell for...
7
by: laura | last post by:
I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore,...
19
by: Pugi! | last post by:
Currently I am studying PHP. I can understand the following : $a = 10; $b = $a++; print("$a, $b"); will print 11, 10 on the screen. because when $b = $a++ first thing that happens is $b = $a...
26
by: Bail | last post by:
I will have a exam on the oncoming friday, my professor told us that it will base upon this program. i am having troubles understanding this program, for example what if i want to add all the...
11
by: Leon | last post by:
Are dataset automatically stored in memory? Does the dispose() method automatically dispose of the dataset in the code below? Do I have to dispose a dataset from memory or does the dataset...
18
by: Simon | last post by:
Hi, I understand what one the differences between std::vector, std::deque and std::list is, the std::vector can have data inserted/deleted at the end. The std::deque can have data...
4
by: joelagnel | last post by:
I'm new to .NET and have a basic understanding of operating systems. I can also do some magic in Csharp, but I lack an understanding of what's going on under the hood, with respect to how windows...
8
by: boki_pfc | last post by:
Hi Everybody, I am looking for an advice on following: I have that "pleasure" of reading C++ codes that have been written by person(s) that have not attended the same C++ classes that I did or...
2
by: subramanian100in | last post by:
Is my following understanding correct ? Data abstraction means providing the interface - that is, the set of functions that can be called by the user of a class. Information hiding means...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.