[freeside-commits] freeside/FS/FS pay_batch.pm,1.14,1.15
Mark Wells
mark at wavetail.420.am
Sat Oct 3 13:22:21 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv26418/FS/FS
Modified Files:
pay_batch.pm
Log Message:
Load XML::Simple at runtime to avoid breakage
Index: pay_batch.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/pay_batch.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- pay_batch.pm 25 Sep 2009 02:30:19 -0000 1.14
+++ pay_batch.pm 3 Oct 2009 20:22:19 -0000 1.15
@@ -4,7 +4,6 @@
use vars qw( @ISA $DEBUG %import_info %export_info $conf );
use Time::Local;
use Text::CSV_XS;
-use XML::Simple qw(XMLin XMLout);
use FS::Record qw( dbh qsearch qsearchs );
use FS::cust_pay;
use FS::Conf;
@@ -241,11 +240,13 @@
# process one line at a time.
if ($filetype eq 'XML') {
+ eval "use XML::Simple";
+ die $@ if $@;
my @xmlkeys = @{ $info->{'xmlkeys'} }; # for XML
my $xmlrow = $info->{'xmlrow'}; # also for XML
# Do everything differently.
- my $data = XMLin($fh, KeepRoot => 1);
+ my $data = XML::Simple::XMLin($fh, KeepRoot => 1);
my $rows = $data;
# $xmlrow = [ RootKey, FirstLevelKey, SecondLevelKey... ]
$rows = $rows->{$_} foreach( @$xmlrow );
More information about the freeside-commits
mailing list