I've tried a sample program using XML::Simple. If the file content is invalid(text file) is given in the XMLin function, the function is quiting the program with an error message, Instead I need it to return to the program with some error notification(undef/-1). Is it possible?
use strict; use warnings; use XML::Simple; use Data::Dumper; my $xs = new XML::Simple(); my $ref = $xs->XMLin("./system.txt"); # Not an xml file. if (not defined $ref) { print "Invalid content in file"; } else { print "\nHash dump:\n"; print Dumper($ref); }
In reply to XML::Simple - Invalid file content by nagalenoj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |