Re: XML::Simple Umlaute

2016-08-09 Thread Chas. Owens
Take a look at the -C argument for perl and the PERL_UNICODE environment variable in http://perldoc.perl.org/perlrun.html Examine the difference between perl -E 'say "\x{df}"' and PERL_UNICODE=O perl -E 'say "\x{df}"' That said, if you are working with the web, why in the world are you sending

Re: XML::Simple Umlaute

2016-08-09 Thread hw
Chas. Owens schrieb: On Thu, Jul 28, 2016 at 10:05 AM, hw wrote: snip So which character encoding on STDOUT does perl use by default? That should be utf-8 without any further ado, shouldn´t it? When I add binmode STDOUT, ":encoding(utf-8)"; the characters are displayed correctly in the te

Re: XML::Simple Umlaute

2016-08-09 Thread hw
Chas. Owens schrieb: On Thu, Jul 28, 2016 at 10:55 AM Paul Johnson mailto:p...@pjcj.net>> wrote: On Thu, Jul 28, 2016 at 10:23:19AM -0400, Chas. Owens wrote: snip > Also, this answer on StackOverflow by tchrist (Tom Christiansen, who I > would say knows the most about the inters

Re: XML::Simple Umlaute

2016-08-09 Thread hw
Paul Johnson schrieb: On Thu, Jul 28, 2016 at 10:23:19AM -0400, Chas. Owens wrote: On Thu, Jul 28, 2016 at 10:05 AM, hw wrote: snip So which character encoding on STDOUT does perl use by default? That should be utf-8 without any further ado, shouldn´t it? When I add binmode STDOUT, ":encod

Re: XML::Simple Umlaute

2016-07-30 Thread Mike Flannigan
to be at groß which is apparently impossible to read. The following program ... #!/usr/bin/perl use strict; use warnings; use feature 'say'; use XML::Simple; use Data::Dumper; my $xml = new XML::Simple; my $data = $xml->XMLin("test.xml"); open my $fh, ">",

Re: XML::Simple Umlaute

2016-07-28 Thread Chas. Owens
On Thu, Jul 28, 2016 at 10:55 AM Paul Johnson wrote: > On Thu, Jul 28, 2016 at 10:23:19AM -0400, Chas. Owens wrote: snip > > Also, this answer on StackOverflow by tchrist (Tom Christiansen, who I > > would say knows the most about the intersection of Perl and Unicode) > > is a good resource: h

Re: XML::Simple Umlaute

2016-07-28 Thread Paul Johnson
On Thu, Jul 28, 2016 at 10:23:19AM -0400, Chas. Owens wrote: > On Thu, Jul 28, 2016 at 10:05 AM, hw wrote: > snip > > So which character encoding on STDOUT does perl use by default? That should > > be utf-8 without any further ado, shouldn´t it? When I add > > > > > > binmode STDOUT, ":encoding(

Re: XML::Simple Umlaute

2016-07-28 Thread Chas. Owens
On Thu, Jul 28, 2016 at 10:05 AM, hw wrote: snip > So which character encoding on STDOUT does perl use by default? That should > be utf-8 without any further ado, shouldn´t it? When I add > > > binmode STDOUT, ":encoding(utf-8)"; > > > the characters are displayed correctly in the terminal. Why

Re: XML::Simple Umlaute

2016-07-28 Thread hw
feature 'say'; use utf8; use XML::Simple; use Data::Dumper; my $xml = new XML::Simple; my $data = $xml->XMLin("test.xml"); open my $fh, ">", 'pout'; binmode $fh, ":encoding(utf-8)"; print $fh Dumper($data); print Dumper($data); print $fh

Re: XML::Simple Umlaute

2016-07-28 Thread Chas. Owens
Data::Dumper is dumping the internal format. To ensure compatibility, it is using the \x{df} escape to represent LATIN SMALL LETTER SHARP S. To see it rendered as a character, just print it: #!/usr/bin/perl use strict; use feature 'say'; use XML::Simple; #warnings should come last

XML::Simple Umlaute

2016-07-28 Thread hw
which is apparently impossible to read. The following program ... #!/usr/bin/perl use strict; use warnings; use feature 'say'; use XML::Simple; use Data::Dumper; my $xml = new XML::Simple; my $data = $xml->XMLin("test.xml"); open my $fh, ">", 'pout

Re: XML Simple + parsing inner loop elements + help

2015-12-08 Thread perl kamal
;t retrieve the inner loop() elements if >> the properties tag contains more than one item. Will you please point >> the error and correct me. >> Please find the attached input xml file. Thanks. > > A quick glance suggests you're getting bitten by one of the known > proble

Re: XML Simple + parsing inner loop elements + help

2015-12-08 Thread shawn wilson
. I'm not sure how you intend to use the output but you might look into basex if you intend to store and parse lots of xml. > use strict; > use XML::Simple; > use Data::Dumper; > You'll find that for lots of uses, ::Simple is too simple. Also note that no perl modules suppor

Re: XML Simple + parsing inner loop elements + help

2015-12-08 Thread Kent Fredric
error and correct me. > Please find the attached input xml file. Thanks. A quick glance suggests you're getting bitten by one of the known problems of XML::Simple: That its completely inconsistent. 2 seemingly identally strucutred XML files can be decoded completely different to each other,

XML Simple + parsing inner loop elements + help

2015-12-07 Thread perl kamal
use strict; use XML::Simple; use Data::Dumper; die "Usage: perl $0 path output_file\n" unless @ARGV == 2; my $path = shift; my $output_file = shift; my ($name,$url,$value,$password,$user,$prop_name,$string); opendir (DIR, "$path") or die "Can't open the d

XML::Simple keyattr

2011-06-08 Thread Jeffrey Joh
I have an issue with XML::simple keyattr. I have two XML files: calif.xml123456CaliforniaSan Francisco123457CaliforniaLos Angeles texas.xml123458TexasHoustonthis file only has one address record. When I use XML::Simple with the condition keyattr => {result -> address -> '

Re: need help with XML::Simple

2010-11-02 Thread galeb abu-ali
kX/Expat' > >> >> > make: *** [subdirs] Error 2 > >> >> > CHORNY/XML-Parser-2.40.tar.gz > >> >> > make -- NOT OK > >> >> > Running make test > >> >> > Can't test without successful make > >> &

Re: need help with XML::Simple

2010-11-01 Thread shawn wilson
gt; >> > Running make install >> >> > Make had returned bad status, install seems impossible >> >> > >> >> > Before installing perl, I also installed the expat library >> expat-2.0.1. >> >> > >> >> > galeb >

Re: need help with XML::Simple

2010-11-01 Thread galeb abu-ali
l, I also installed the expat library > expat-2.0.1. > >> > > >> > galeb > >> > > >> > > >> > On Mon, Nov 1, 2010 at 1:17 PM, Jim Gibson > wrote: > >> > > >> >> On 11/1/10 Mon Nov 1, 2010 10:01 AM, "g

Re: need help with XML::Simple

2010-11-01 Thread galeb abu-ali
1. > > > > galeb > > > > > > On Mon, Nov 1, 2010 at 1:17 PM, Jim Gibson wrote: > > > >> On 11/1/10 Mon Nov 1, 2010 10:01 AM, "galeb abu-ali" < > >> abuali...@gmail.com> > >> scribbled: > >> >

Re: need help with XML::Simple

2010-11-01 Thread galeb abu-ali
son wrote: > On 11/1/10 Mon Nov 1, 2010 10:01 AM, "galeb abu-ali" < > abuali...@gmail.com> > scribbled: > > > Hi, > > > > I installed BioPerl on RHEL 5.5 (successfully I hope) and am trying to > > execute a xml parser script that uses XML::Simple.

Re: need help with XML::Simple

2010-11-01 Thread Jim Gibson
On 11/1/10 Mon Nov 1, 2010 10:01 AM, "galeb abu-ali" scribbled: > Hi, > > I installed BioPerl on RHEL 5.5 (successfully I hope) and am trying to > execute a xml parser script that uses XML::Simple. I keep getting the > following error message: > > could not

need help with XML::Simple

2010-11-01 Thread galeb abu-ali
Hi, I installed BioPerl on RHEL 5.5 (successfully I hope) and am trying to execute a xml parser script that uses XML::Simple. I keep getting the following error message: could not find ParserDetails.ini in /usr/local/lib/perl5/site_ perl/5.12.2/XML/SAX When I try to reinstall XML::Simple using

Re: XML::Simple XMLin

2010-07-28 Thread Jasper2000
Brandon / Erez, Thanks very much for your help. Not sure why, but I did post another message, to say that I'd managed to figure it out, yet the message didn't show up. However, I really do appreciate your comments and willingness to help me. Thanks!! On Jul 28, 6:10 pm, bamcc...@gmail.com (Bra

Re: XML::Simple XMLin

2010-07-28 Thread Jane D.
Actually, I have now figured it out, and it all makes sense! Thanks for your help. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: XML::Simple XMLin

2010-07-28 Thread Brandon McCaig
On Tue, Jul 27, 2010 at 6:31 PM, Jane D. wrote: > The top bit of the XML file looks like this: It would be easier for me to make suggestions if you'd post an entire sample XML document or, better yet, a URL where I could retreive one so that I could test my code before suggesting it to you. :) -

Re: XML::Simple XMLin

2010-07-28 Thread Erez Schatz
First, I urge you to try parsing this doc with a dedicated RSS parser, it will do miracles for your needs. Second, the dumper you print here is not the full document, but one branch, it might be that what you loop over is not an arrayref, or might not work the way you think. Try running a Dumper ov

Re: XML::Simple XMLin

2010-07-28 Thread Jasper2000
Thanks Erez ... However, I did already look at the data in Data:Dumper, and still can't figure out how to access it. Mind you, I have done an identical loop for other XML data, from other sources, and it works fine (even with the element set to 0, which I don't quite get). Mind you, if it's of any

Re: XML::Simple XMLin

2010-07-27 Thread Erez Schatz
On 28 July 2010 01:31, Jane D. wrote: > > I'm basically retrieving an XML file from Digg. I can retrieve the > Digg data okay, but am struggling with trying to process the returned > data with Perl, largely on account with my unfamiliarity with XML > processing, but also because I'm not entirely c

XML::Simple XMLin

2010-07-27 Thread Jane D.
, but also because I'm not entirely confident with handling arrays like this. Here's a stripped down version of the main bit of code: my $xml = new XML::Simple; my $data = $xml->XMLin("$diggdata",ForceArray=>1); foreach my $record (@{$data->{stories}->[0]->{story}})

Help XML::Simple a weird behaviour

2010-04-19 Thread Jins Thomas
Hi all, Would somebody please show some light on what's happening here. I'm trying to parse a sample xml file like below Dummy1 Dummy2 When i run to parse with a sample script like below use XML::Simple; use Data::Dumper; my $lXMLFile =

Re: Perl - XML Simple - Find Duplicates

2010-02-14 Thread sub
Thanks Shawn for replying. I should have clarified. I am trying to parse an xml file that is hand edited and at times it contains duplicates (same entry twice) - due to bad cut and paste. I would like to find a way to display these duplicates. -- To unsubscribe, e-mail: beginners-unsubscr...@per

Re: Perl - XML Simple - Find Duplicates

2010-02-13 Thread Shawn H Corey
sub wrote: > Hi, > > When can I use perl xml simple to find duplicates in a xml file ? It > seems to remove the duplicates everytime I use it. What do you mean by duplicates? The definition of XML states that there can one be one of each attribute for each element, and each elem

Perl XML Simple

2010-02-13 Thread sub
Is it possible to use Perl XML Simple to check for duplicates ? When I use it, it seems to be omitting the dupes. -Kevin. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Perl - XML Simple - Find Duplicates

2010-02-13 Thread sub
Hi, When can I use perl xml simple to find duplicates in a xml file ? It seems to remove the duplicates everytime I use it. Thanks, Sub. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: XML::Simple parsing with attributes

2010-01-25 Thread Dr.Ruud
Shlomi Fish wrote: XML::Compile seems to be for SOAP, which is a subset of the general XML functionality. It looks to me like your reading problems are still not over. In its documentation it says to be about "translate between XML and nested hashes". And also about validation. And also abo

Re: XML::Simple parsing with attributes

2010-01-22 Thread Jenda Krynicky
> > > > > Wrong! If for example you have something like {{{ Hello this is a > > href="http://www.example.tld/";>link for something }}}, then > > > XML-Simple will make a mess out of it. And XML-Simple tends to break > > > more often than not, and is p

Re: XML::Simple parsing with attributes

2010-01-22 Thread Shlomi Fish
e something like {{{ Hello this is a > href="http://www.example.tld/";>link for something }}}, then > > XML-Simple will make a mess out of it. And XML-Simple tends to break > > more often than not, and is philosopically unsound. > > Lovely. So you just found a type

Re: XML::Simple parsing with attributes

2010-01-21 Thread Jenda Krynicky
for something }}}, then > XML-Simple > will make a mess out of it. And XML-Simple tends to break more often than > not, > and is philosopically unsound. Lovely. So you just found a type of XMLs that is and never was meant to be handled by XML::Simple and no one would ever sugges

Re: XML::Simple parsing with attributes

2010-01-21 Thread Jenda Krynicky
Date sent: Fri, 15 Jan 2010 11:11:55 -0800 Subject:XML::Simple parsing with attributes From: Grant To: Perl Beginners List > Anybody here familiar with XML::Simple? I need to parse some XML that > looks lik

Re: XML::Simple parsing with attributes

2010-01-20 Thread Brad Baxter
On 1/15/2010 2:11 PM, Grant wrote: Anybody here familiar with XML::Simple? I need to parse some XML that looks like this: base64datahere base64datahere base64datahere I need to be able to grab the correct set of base64 data. Does anyone know how to do that? - Grant The "correc

Re: XML::Simple parsing with attributes

2010-01-18 Thread Dr.Ruud
Shlomi Fish wrote: On Saturday 16 Jan 2010 14:32:13 Dr.Ruud wrote: Shlomi Fish wrote: rindolf: XML::Simple commits the fatal flaw of trying to massage complicated and often irregular XML into the simple and highly regular world of perl data structures. That is a strange sentence. I think

Re: XML::Simple parsing with attributes

2010-01-16 Thread Grant
>>>> >>>>> >>>>> base64datahere >>>>> base64datahere >>>>> base64datahere >>>>> >>>>> >>>>> > >>> #!/usr/bin/perl >>> >>> use strict; >&g

Re: XML::Simple parsing with attributes

2010-01-16 Thread Shlomi Fish
On Saturday 16 Jan 2010 14:32:13 Dr.Ruud wrote: > Shlomi Fish wrote: > > On Friday 15 Jan 2010 21:11:55 Grant wrote: > >> Anybody here familiar with XML::Simple? I need to parse some XML that > > > >> looks like this: > > Do

Re: XML::Simple parsing with attributes

2010-01-16 Thread Erez Schatz
2010/1/16 Grant : >>> >>>> >>>> base64datahere >>>> base64datahere >>>> base64datahere >>>> >>>> >>>> >> #!/usr/bin/perl >> >> use strict; >> use warnings; >> use XML::Si

Re: XML::Simple parsing with attributes

2010-01-16 Thread Dr.Ruud
Shlomi Fish wrote: On Friday 15 Jan 2010 21:11:55 Grant wrote: Anybody here familiar with XML::Simple? I need to parse some XML that looks like this: Don't use XML::Simple. It is anything but. { You need to get rid of those ugly things, they make your postings ut

Re: XML::Simple parsing with attributes

2010-01-16 Thread Shlomi Fish
On Saturday 16 Jan 2010 17:17:12 Grant wrote: > >> Anybody here familiar with XML::Simple? I need to parse some XML that > > > >> looks like this: > > Don't use XML::Simple. It is anything but. > > > > {{{{{{{{{ > > perlbot: xml::Si

Re: XML::Simple parsing with attributes

2010-01-16 Thread Grant
>> >>> >>> base64datahere >>> base64datahere >>> base64datahere >>> >>> >>> >>> I need to be able to grab the correct set of base64 data.  Does anyone >>> know how to do that? > > It's

Re: XML::Simple parsing with attributes

2010-01-16 Thread Grant
>> Anybody here familiar with XML::Simple?  I need to parse some XML that >> looks like this: >> > > Don't use XML::Simple. It is anything but. > > {{{{{ > perlbot: xml::Simple > rindolf: XML::Simple commits the fatal flaw of trying to mass

Re: XML::Simple parsing with attributes

2010-01-15 Thread Erez Schatz
> >> >> base64datahere >> base64datahere >> base64datahere >> >> >> >> I need to be able to grab the correct set of base64 data.  Does anyone >> know how to do that? It's a common practice, to avoid using XML::Simple. It's

Re: XML::Simple parsing with attributes

2010-01-15 Thread Shlomi Fish
On Friday 15 Jan 2010 21:11:55 Grant wrote: > Anybody here familiar with XML::Simple? I need to parse some XML that > looks like this: > Don't use XML::Simple. It is anything but. {{{{{ perlbot: xml::Simple rindolf: XML::Simple commits the fatal flaw of try

XML::Simple parsing with attributes

2010-01-15 Thread Grant
Anybody here familiar with XML::Simple? I need to parse some XML that looks like this: base64datahere base64datahere base64datahere I need to be able to grab the correct set of base64 data. Does anyone know how to do that? - Grant -- To unsubscribe, e-mail: beginners-unsubscr

Re: XML::Simple question

2009-12-23 Thread Mike Blezien
- Original Message - From: "Jenda Krynicky" To: "Perl List" Sent: Tuesday, December 22, 2009 6:44 PM Subject: Re: XML::Simple question From: "Mike Blezien" Hello, were using the XML/Simple module to process a XML response using the code

Re: XML::Simple question

2009-12-22 Thread Jenda Krynicky
From: "Mike Blezien" > Hello, > > were using the XML/Simple module to process a XML response using the code > below. > But for some reason the module can't read the $xmlresponse data unless we > create > a temp file first to store the d

Re: XML::Simple question

2009-12-22 Thread Mike Blezien
- Original Message - From: "Robert Wohlfarth" To: "Perl List" Sent: Tuesday, December 22, 2009 5:47 PM Subject: Re: XML::Simple question On Tue, Dec 22, 2009 at 9:54 AM, Mike Blezien wrote: were using the XML/Simple module to process a XML response using the

Re: XML::Simple question

2009-12-22 Thread Robert Wohlfarth
On Tue, Dec 22, 2009 at 9:54 AM, Mike Blezien wrote: > were using the XML/Simple module to process a XML response using the code > below. But for some reason the module can't read the $xmlresponse data > unless we create a temp file first to store the data then pass that to the >

XML::Simple question

2009-12-22 Thread Mike Blezien
Hello, were using the XML/Simple module to process a XML response using the code below. But for some reason the module can't read the $xmlresponse data unless we create a temp file first to store the data then pass that to the module. Is there a way to do this without having to create a

Re: xml simple question

2009-10-23 Thread Shlomi Fish
On Friday 23 Oct 2009 15:16:15 Shawn H Corey wrote: > getget wrote: > > The content of 2 files output.xml and input.xml are different. How can > > I create the output file its content the same with input.xml. > > Use a different parser than XML::Simple. I suggest XML::Twig.

Re: xml simple question

2009-10-23 Thread Shawn H Corey
getget wrote: > The content of 2 files output.xml and input.xml are different. How can > I create the output file its content the same with input.xml. Use a different parser than XML::Simple. I suggest XML::Twig. XML::Simple does not distinguish between attributes and content. Because o

xml simple question

2009-10-23 Thread getget
Hi All. When using XML::Sample, I have a question, who can help me. First I have output.xml file: Mp3 converter Real player Microsoft project Poedit Metrix Line Sudoku I use XML::Sample to read, after that I save to ou

Re: XML::Simple question

2008-10-22 Thread Richard Lee
ot; height="190" /> I tried $book->{image}->{src}... but doesn't work.. I need some understanding on how these information is stored. parsing code use XML::Simple qw(:strict); my $library = XMLin($filename, ForceArray => 1, KeyAttr=> {}

Re: XML::Simple question

2008-10-22 Thread Rob Dixon
width="145" height="190" /> > > > I tried $book->{image}->{src}... but doesn't work.. I need some > understanding on how these information is stored. > > > > parsing code > > use XML::Simple qw(:strict); > > my $

Re: XML::Simple question

2008-10-22 Thread Dr.Ruud
Richard Lee schreef: > how do I parse out > > http://www.oreilly.com/catalog/covers/perlbp.s.gif"; > width="145" height="190" /> > > I tried $book->{image}->{src}... but doesn't work.. > > use XML::Simple qw(:stric

XML::Simple question

2008-10-21 Thread Richard Lee
$book->{image}->{src}... but doesn't work.. I need some understanding on how these information is stored. parsing code use XML::Simple qw(:strict); my $library = XMLin($filename, ForceArray => 1, KeyAttr=> {}, ); foreach my $book (@{$library->{book}}) {

Re: XML::Simple Environment errors

2008-07-24 Thread Jenda Krynicky
From: "Gorrebeeck, Robert" <[EMAIL PROTECTED]> > bash-3.2$ perl -mXML::Parser -e 'print "$XML::Parser::VERSION"' > > Can't load > '/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/XML/Parser/Expat > /Expat.so' for module XML::Parser::Expat: ld.so.1: perl: fatal: > libgcc_s.so.1: open failed

XML::Simple Environment errors

2008-07-23 Thread Gorrebeeck, Robert
Hello all We recently migrated over to a new server and installed the new version of XML::Simple and am getting errors when I try to parse an XML file. I get an error stating: XMLin() requires either XML::SAX or XML::Parser I have verified that both modules are installed

Re: Question about XML::Simple [was: XML to inMemory Hash]

2007-08-02 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Thomas Polnik wrote: > > > >> Almost anything is better than XML::Simple, but no module can > >> easily make your data any smaller. > > > > I use XML::Simple without any problems since some years. Which > &

Re: Question about XML::Simple [was: XML to inMemory Hash]

2007-08-01 Thread Rob Dixon
Thomas Polnik wrote: Almost anything is better than XML::Simple, but no module can easily make your data any smaller. I use XML::Simple without any problems since some years. Which problems could I get with with this package? My programm converts many small xml-files (<100kb) to a p

Question about XML::Simple [was: XML to inMemory Hash]

2007-08-01 Thread thomas polnik
Hello Rob, > Almost anything is better > than XML::Simple, but no module can easily make your data any smaller. I use XML::Simple without any problems since some years. Which problems could I get with with this package? My programm converts many small xml-files (<100kb) to a perl struct

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-15 Thread [EMAIL PROTECTED]
In the documentation it says that you can read files chunks at a time but I haven't tried it. > Ken Foskey > FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-15 Thread Chas Owens
On 6/15/07, Ken Foskey <[EMAIL PROTECTED]> wrote: On Fri, 2007-06-15 at 14:08 -0700, [EMAIL PROTECTED] wrote: > Sweet Chas! > > My two cents is to check out XML::Twig at http://www.xmltwig.org/ . > > It's easy to get a grip on and well suited to reading attributes as > well as elements in element

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-15 Thread Ken Foskey
On Fri, 2007-06-15 at 14:08 -0700, [EMAIL PROTECTED] wrote: > Sweet Chas! > > My two cents is to check out XML::Twig at http://www.xmltwig.org/ . > > It's easy to get a grip on and well suited to reading attributes as > well as elements in elements. Looks interesting, would this reasonably hand

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-15 Thread [EMAIL PROTECTED]
Sweet Chas! My two cents is to check out XML::Twig at http://www.xmltwig.org/ . It's easy to get a grip on and well suited to reading attributes as well as elements in elements. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.or

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Ray
On Jun 14, 11:17 am, [EMAIL PROTECTED] (Chas Owens) wrote: > Do you mean like this? > > #!/usr/bin/perl > > use strict; > use warnings; > > use XML::Simple; > > my $xml = XMLin(join "", ); > > for my $rec (@{$xml->{RejectRecord}}) { >

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Chas Owens
quot;1234"). I am interested in iterating through the Customer Code. Thanks again for your help! Ray Do you mean like this? #!/usr/bin/perl use strict; use warnings; use XML::Simple; my $xml = XMLin(join "", ); for my $rec (@{$xml->{RejectRecord}}) { printf qq(customer

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Ray
On Jun 14, 6:26 am, [EMAIL PROTECTED] (Chas Owens) wrote: > > However, I bet you want to iterator over all of the contents of the > RejectRecord key like this > > my $max = @{$ref->{RejectRecord}}; > for my $i (1 .. $max) { > print "record $i of $max failed because > $ref->{RejectRecord}[$i-1]{

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Chas Owens
On 6/14/07, Ray <[EMAIL PROTECTED]> wrote: On Jun 14, 6:26 am, [EMAIL PROTECTED] (Chas Owens) wrote: > > However, I bet you want to iterator over all of the contents of the > RejectRecord key like this > > my $max = @{$ref->{RejectRecord}}; > for my $i (1 .. $max) { > print "record $i of $max

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Ray
On Jun 14, 6:26 am, [EMAIL PROTECTED] (Chas Owens) wrote: > > However, I bet you want to iterator over all of the contents of the > RejectRecord key like this > > my $max = @{$ref->{RejectRecord}}; > for my $i (1 .. $max) { > print "record $i of $max failed because > $ref->{RejectRecord}[$i-1]{

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Chas Owens
On 6/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi I'm struggling with the use of XML::Simple so was hoping that someone might be able to help me. I'm kind of new to perl, especially when dealing with hash references. I would like to iterate through the hash that is crea

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread Jeff Pang
[EMAIL PROTECTED] 写道: The a sample of the contents of the XML file is found below: Notice that I've hardcode the first reference to Rejected Records by using [0]. Well I need to know how of these there are in the hashref $ref so I can iterate through. Hello, Since you've used Data::Dumper you

Iterate through a hashref using XML::Simple

2007-06-14 Thread olson . ray
Hi, I'm struggling with the use of the XML::Simple package and was hoping to get some help. I'm kind of new to perl, especially dealing with hash references. I would like to be able to iterate through a hashref that is built using XMLin. Here is the code: -- To unsubscribe, e-ma

Iterate through a hashref using XML::Simple (real post)

2007-06-14 Thread olson . ray
Hi I'm struggling with the use of XML::Simple so was hoping that someone might be able to help me. I'm kind of new to perl, especially when dealing with hash references. I would like to iterate through the hash that is created by the XMLIn function. Here is my code: use Env

Re: how to use xml::simple with nested for loops???

2007-04-19 Thread Rob Dixon
Dave Gauthier wrote: Going back a couple weeks regarding the nested foreach to read out nested data using XML::Simple, your solution works great, Thanks ! But a new requirement is that I sort the output foreach (@{$xml->{FOREST}}) { print $_->{NAME}, ":\n"; fore

Re: how to use xml::simple with nested for loops???

2007-04-18 Thread Jay Savage
On 4/18/07, Gauthier, Dave <[EMAIL PROTECTED]> wrote: Hi Jay: Going back a couple weeks regarding the nested foreach to read out nested data using XML::Simple, your solution works great, Thanks ! But a new requirement is that I sort the output foreach (@{$xml->{FOREST}}) {

Re: Beginner question about XML::Simple

2007-04-04 Thread Rob Dixon
ippet Reading this with XML::Simple and Dumping it gives me 'TPM:Requires' => { 'TPM:TLCore' => { 'name' => 'collection-basic' }, 'TPM:Package' => { 'cmextra' => {}, 'was

Beginner question about XML::Simple

2007-04-04 Thread Gerben Wierda
ippet Reading this with XML::Simple and Dumping it gives me 'TPM:Requires' => { 'TPM:TLCore' => {

Re: how to use xml::simple with nested for loops???

2007-04-03 Thread Rob Dixon
Gauthier, Dave wrote: Hi: I'm trying to construct something like a nested for loop structuire to read the data out of an XML file using XML::Simple. Here's the sample xml... 4.0,70.0 4.1,70.1 4.2,70.2 5.0,80.0 5.1,80.1

how to use xml::simple with nested for loops???

2007-04-03 Thread Gauthier, Dave
Hi: I'm trying to construct something like a nested for loop structuire to read the data out of an XML file using XML::Simple. Here's the sample xml... 4.0,70.0 4.1,70.1 4.2,70.2 5.0,80.0 5.1,80.1 5.2,80.2

Re: XML::Simple help request

2006-08-22 Thread Owen
{ > > 'email' => > > '[EMAIL PROTECTED]', 'uid' => '158149474', 'remarks' =[1]> '', > > 'alias' => '' > > } > &g

Re: XML::Simple help request

2006-08-22 Thread Mumia W.
id' => '158149474', 'remarks' =[1]> '', 'alias' => '' } ] } ], 'last-name' => '', 'nick-name' => '

Re: XML::Simple help request

2006-08-22 Thread Gary Stainburn
'alias' => '' >} > ] > } > ], > 'last-name' => '', &g

XML::Simple help request

2006-08-21 Thread Owen Cook
7;alias' => '' } ] } ], 'last-name' => '', 'nick-name' => '' }; I cannot get my head

Re: v2: XML: :Simple-handling {changing element name}

2006-07-26 Thread Mumia W.
nt "attribute:\n"; foreach my $key (keys %$variable) { print qq{ $key => "$variable->{$key}"\n}; } exit; package XML::VeryComplex; use base 'XML::Simple'; package main; __DATA__ -- To unsubscribe, e-mai

v2: XML: :Simple-handling {changing element name}

2006-07-26 Thread BW
s and have (to see the first occurrence) tried in the code: $data->{dataschemas}->{dataschema}->[0]->{attributes}->{attribute}} and $data->{dataschemas}->{dataschema}[0]->{attributes}->{attribute}} Neither worked and I'm not sure from the XML::Simple documentation

XML: :Simple-handling {changing element name}

2006-07-26 Thread BW
How (assuming it does) does XML::Simple deal with an XML element whose value changes throughout the course of the Dumper output? XML::Simple code snippet: $data->{dataschemas}->{dataschema}{changing element name}->{attributes}->{attribute}} Dumper output snippet: (format adjusted

Re: XML: :Simple -- still can't print: Dumper OK

2006-07-26 Thread Mumia W.
On 07/26/2006 11:08 AM, BW wrote: And please don't snip attributions. Firstly, to make sure I'm exercising proper etiquette here, could you please explain what I snipped so that I don't do that in the future? I finally got this working. I'd been leaving out one of the items in my hash derefere

Re: XML: :Simple -- still can't print: Dumper OK

2006-07-26 Thread BW
. Once I put that item in place, I started seeing output. Thanks for all your assistance. --- "Mumia W." <[EMAIL PROTECTED]> wrote: > On 07/25/2006 03:36 PM, BW wrote: > > Mumia W. wrote: > >> Did you enable ForceArray? > >> > >> Did you us

Re: XML: :Simple -- still can't print: Dumper OK

2006-07-25 Thread Mumia W.
On 07/25/2006 03:36 PM, BW wrote: Mumia W. wrote: Did you enable ForceArray? Did you use Data::Dumper to look at the structure of what XML::Simple returned? Yes to both. I've attached the Dumper output. (outp.txt). Given the attached xml file, and your first snippet/example, I tried

Re: XML: :Simple -- still can't print: Dumper OK

2006-07-25 Thread BW
> Did you enable ForceArray? > > Did you use Data::Dumper to look at the structure of what XML::Simple returned? Yes to both. I've attached the Dumper output. (outp.txt). Given the attached xml file, and your first snippet/example, I tried to do something very simple: print out

RE: XML: :Simple -- can't print still: config problem?

2006-07-25 Thread Venkat Saranathan
with warm regards, Venkat Saranathan Gulf Breeze Software www.gulfsoft.com GulfBreeze Blog www.gulfsoft.com/blog -Original Message- From: brian bwarn [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 25, 2006 11:50 AM To: beginners@perl.org Subject: RE: XML: :Simple -- can't print still:

  1   2   >