Legend:
- Unmodified
- Added
- Removed
-
shepherd
r10 r11 30 30 # * --ready option that says whether config is required? 31 31 32 BEGIN { *CORE::GLOBAL::die = \&my_die; } 32 33 use strict; 33 34 use LWP::Simple; … … 262 263 my $parse_start_time = [gettimeofday]; 263 264 printf STDERR "SHEPHERD: Started parsing XMLTV from '%s' in '%s' .. any errors below are from parser:\n",$plugin,$output; 264 eval { 265 local $SIG{__DIE__}, 266 $plugin_data->{$plugin}->{xmltv} = XMLTV::parsefiles($output); 267 }; 268 printf STDERR "SHEPHERD: Warning: Parser returned the following: $@\n" if $@; 265 eval { $plugin_data->{$plugin}->{xmltv} = XMLTV::parsefiles($output); }; 269 266 printf STDERR "SHEPHERD: Completed XMLTV parsing from '%s' in %0.2f seconds\n",$plugin,tv_interval($parse_start_time); 270 267 … … 1122 1119 } 1123 1120 1121 # ----------------------------------------- 1122 # Subs: override handlers for standard perl. 1123 # ----------------------------------------- 1124 1125 # ugly hack. please don't try this at home kids! 1126 sub my_die { 1127 my ($arg,@rest) = @_; 1128 my ($pack,$file,$line,$sub) = caller(1); 1129 1130 # check if we are in an eval() 1131 if ($^S) { 1132 printf STDERR " shepherd caught a die() within eval{} from file $file line $line\n"; 1133 } else { 1134 if (!ref($arg)) { 1135 CORE::die((sprintf "DIE at line %d in file %s: %s\n",$line,$file,(join("",($arg,@rest))))); 1136 } else { 1137 CORE::die($arg,@rest); 1138 } 1139 } 1140 } 1141
