Re: checking hashref for value

2006-12-05 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > From: Rob Dixon <[EMAIL PROTECTED]> > >> Hi Dermot > >> > >> You get some fun stuff to do don't you! > >> > >> To be honest I wouldn't go near XML::Simple because of exactly the > >> problems you're experiencing. It turns XML into a ne

Re: checking hashref for value

2006-12-04 Thread Rob Dixon
Jenda Krynicky wrote: From: Rob Dixon <[EMAIL PROTECTED]> Hi Dermot You get some fun stuff to do don't you! To be honest I wouldn't go near XML::Simple because of exactly the problems you're experiencing. It turns XML into a nested hash structure where the hash values can be a hash reference,

Re: checking hashref for value

2006-12-04 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Hi Dermot > > You get some fun stuff to do don't you! > > To be honest I wouldn't go near XML::Simple because of exactly the > problems you're experiencing. It turns XML into a nested hash > structure where the hash values can be a hash reference, an array >

Re: checking hashref for value

2006-12-04 Thread Rob Dixon
Beginner wrote: On 4 Dec 2006 at 8:47, Tom Phoenix wrote: On 12/4/06, Beginner <[EMAIL PROTECTED]> wrote: print "found $ref->{'order_number'}\n"; I get "found HASH(0xacacfe8)". That's a reference to a hash. It sounds as if you might want to ask the question "Is that hash empty or not

Re: checking hashref for value

2006-12-04 Thread Jenda Krynicky
From: "Beginner" <[EMAIL PROTECTED]> > Yes that worked fine. Thanx. Within the same xml file structure I also > have > > 'address' => { >'line' => [ > { >'line' => 'STARLING ROOFING' >

Re: checking hashref for value

2006-12-04 Thread Beginner
On 4 Dec 2006 at 8:47, Tom Phoenix wrote: > On 12/4/06, Beginner <[EMAIL PROTECTED]> wrote: > > > print "found $ref->{'order_number'}\n"; > > > I get "found HASH(0xacacfe8)". > > That's a reference to a hash. It sounds as if you might want to ask > the question "Is that hash empty or no

Re: checking hashref for value

2006-12-04 Thread Tom Phoenix
On 12/4/06, Beginner <[EMAIL PROTECTED]> wrote: print "found $ref->{'order_number'}\n"; I get "found HASH(0xacacfe8)". That's a reference to a hash. It sounds as if you might want to ask the question "Is that hash empty or not?", which the keys() function can answer: if (keys %{

checking hashref for value

2006-12-04 Thread Beginner
Hi, I am trying to parse a xml file. Some of the tags are empty, like this one: # Data::Dumper output 'order_number' => {}, I have been trying to check if there is any content within the hashref (say for order_number) returned by XML::Simple but I am not getting the results I had hoped for.