eval{ # try to parse xml file 1; } or do { # do exception handling };