TS 6.5, Solaris.
I am processing some dcr's with TeamSite::XMLnode. Here's a snippet where I am just loading the file into the node object.
my $tmp = &openFile($showPath);
#instantiate xml parser to get fields
my $rootnode_tmp = TeamSite::XMLnode->new($tmp);
#get fields
my $title = $rootnode_tmp->value('TITLE');
I want to catch the xml parser error so my script runs through the rest of the files. I have a little subroutine for writing errors to the log file.
&writeDebug( "$showPath\txml Parse Error!!\n");
next;
since this is in a loop, I just want to catch the error, write somethng to the log file, and move on.
Any ideas? I think I maybe need an eval block from searching online, but it doesn't seem to be working.
eval { my $rootnode_tmp = TeamSite::XMLnode->new("$tmp")};
if ($
@){ &writeDebug( "$showPath\txml Parse Error!!\n");
next;
}