bkiahg has asked for the wisdom of the Perl Monks concerning the following question:
Everything works except the sorting. BTW I'm using activeperl 5.8 810 with xml::simple 2.12. Thanks in advance!#! C:\Perl\bin\perl.exe -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use XML::Simple; use File::Copy; my $path = "C:\\web\\policies\\"; my $folder; my($old_file_name, $old_file, $policy_number, $name, $desc, $link_name +, $bytesread, $buffer); ############################## # Open xml document and edit # ############################## if ($file) { $link_name = $policy_number . " " . $name . '.doc' } else { $link_name = $old_file } my $xs = new XML::Simple; my $xml = $xs->XMLin("$folder_path\\policies.xml", forcearray => 1, ke +yattr => ['policies']); foreach my $this (@{$xml->{policies}}) { if ($this->{name} eq $old_file_name) { $this->{link_name} = $link_name; $this->{description} = $desc; $this->{policy_number} = $policy_number; $this->{name} = $name; last; } } $xs->XMLout($xml, outputfile => "$folder_path\\policies.xml", attrinde +nt => 1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple Not Sorting
by jeffa (Bishop) on Jun 25, 2004 at 19:06 UTC | |
by bkiahg (Pilgrim) on Jun 25, 2004 at 19:29 UTC | |
by bkiahg (Pilgrim) on Jun 25, 2004 at 20:28 UTC | |
by jeffa (Bishop) on Jun 25, 2004 at 20:32 UTC |