[26958] in Perl-Users-Digest
Perl-Users Digest, Issue: 8915 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 3 11:05:23 2006
Date: Fri, 3 Feb 2006 08:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 3 Feb 2006 Volume: 10 Number: 8915
Today's topics:
Recursive chmod/chown <cwaiken@nospam.com>
XML::Simple Parsing with Attributes problem <john@heathdrive.com>
XML::Simple Parsing with Attributes problem <john@heathdrive.com>
Re: XML::Simple Parsing with Attributes problem <bernard.el-haginDODGE_THIS@lido-tech.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 03 Feb 2006 10:46:20 -0500
From: Christopher W Aiken <cwaiken@nospam.com>
Subject: Recursive chmod/chown
Message-Id: <f9u6u1tav2kcskgck2hkiuhb2ifpvar649@4ax.com>
In UNIX a simple "-R" option on the "chmod/chgrp/chown" command
will traverse all files and directories. Is there a simple way of
doing this same thing is a Perl script?
-=[cwa]=-
------------------------------
Date: Fri, 3 Feb 2006 11:39:34 -0000
From: "John" <john@heathdrive.com>
Subject: XML::Simple Parsing with Attributes problem
Message-Id: <6a2dnbQPtNNr3X7eRVnyug@eclipse.net.uk>
Hi - problem parsing with an attribute name.
<england>
<town code="LON">Capital City</town>
<town code="MAN">Manchester</town>
<town code="BHAM">Birmingham</town>
</england>
I'm using XML::Simple.
$xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
$data = $xml->XMLin($xmlfile);
$which=$data->{england}->[0]->{town}->[0]; doesn't work.
I need to access both attribute value and its contents (BHAM and
Birmingham).
Any ideas?
John
------------------------------
Date: Fri, 3 Feb 2006 11:36:12 -0000
From: "John" <john@heathdrive.com>
Subject: XML::Simple Parsing with Attributes problem
Message-Id: <6a2dnbUPtNNr3X7eRVnyug@eclipse.net.uk>
Hi - problem parsing with an attribute name.
<england>
<town code="LON">Capital City</town>
<town code="MAN">Manchester</town>
<town code="BHAM">Birmingham</town>
</england>
I'm using XML::Simple.
$xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
$data = $xml->XMLin($xmlfile);
$which=$data->{england}->[0]->{town}->[0]; doesn't work.
I need to access both attribute value and its contents (BHAM and
Birmingham).
Any ideas?
John
------------------------------
Date: Fri, 3 Feb 2006 13:01:11 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: XML::Simple Parsing with Attributes problem
Message-Id: <Xns975F8471CAEFDelhber1lidotechnet@10.232.40.227>
"John" <john@heathdrive.com> wrote:
> Hi - problem parsing with an attribute name.
>
> <england>
> <town code="LON">Capital City</town>
> <town code="MAN">Manchester</town>
> <town code="BHAM">Birmingham</town>
> </england>
>
> I'm using XML::Simple.
>
> $xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
> $data = $xml->XMLin($xmlfile);
>
> $which=$data->{england}->[0]->{town}->[0]; doesn't work.
>
> I need to access both attribute value and its contents (BHAM and
> Birmingham).
>
> Any ideas?
Print out the structure XML::Simple creates (using Data::Dumper) and see for yourself. I suspect it
should be something along the lines of
$data->{'england'}->{'town'}->[0]->{'code'}
to get the code of the first town.
--
Cheers,
Bernard
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8915
***************************************