Changeset 190 for shepherd

Show
Ignore:
Timestamp:
11/07/06 00:26:22 (7 years ago)
Author:
lincoln
Message:

consolidate logging into tv_grab_au via call_prog, remove all logging from shepherd

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • shepherd

    r183 r190  
    2222#                        (e.g. flag HDTV programmes, augment with IMDb etc.) 
    2323 
    24 my $version = '0.2.32'; 
     24my $version = '0.2.33'; 
    2525 
    2626# Changelog: 
     
    5656# 0.2.31  : split tv_grab_au (install/test/upgrade/enable/disable) from 
    5757#           shepherd (grab/reconcile/postprocess) 
     58# 0.2.33  : remove logging (tv_grab_au does it for us) 
    5859 
    5960BEGIN { *CORE::GLOBAL::die = \&my_die; } 
     
    133134my $config_file =   "$CWD/$progname.conf"; 
    134135my $channels_file = "$CWD/channels.conf"; 
    135 my $log_file = "$CWD/$progname.log"; 
    136136my $days = 7; 
    137137my $missing; 
     
    172172 
    173173&get_remaining_command_line_options; 
    174 &open_logfile unless ($opt->{nolog}); 
    175174 
    176175&process_setup_commands; 
     
    190189} 
    191190 
    192 &log("Done.\n"); 
    193 &close_logfile() unless $opt->{nolog}; 
    194  
    195191# --------------------------------------------------------------------------- 
    196192# --- Subroutines 
     
    205201    my $used_grabbers = 0; 
    206202 
    207     &log("\nGrabber stage.\n"); 
     203    printf "\nGrabber stage.\n"; 
    208204 
    209205    &analyze_plugin_data("",1);     
     
    216212        $components->{$grabber}->{laststatus} = "unknown"; 
    217213 
    218         &log((sprintf "\nSHEPHERD: Using grabber: (%d) %s\n", $used_grabbers, $grabber)); 
     214        printf "\nSHEPHERD: Using grabber: (%d) %s\n", $used_grabbers, $grabber; 
    219215 
    220216        my $output = "$CWD/grabbers/$grabber/output.xmltv"; 
     
    230226        if (query_config($grabber, 'category') == 1) 
    231227        { 
    232             &log("$grabber is Category 1: grabbing timeslice.\n") if ($debug); 
     228            printf "$grabber is Category 1: grabbing timeslice.\n" if ($debug); 
    233229 
    234230            record_requested_chandays($grabber, $timeslice); 
     
    266262        else 
    267263        { 
    268             &log("$grabber is category 2: grabbing everything.\n") if ($debug); 
     264            printf "$grabber is category 2: grabbing everything.\n" if ($debug); 
    269265            $comm .= " --days $days" if ($days); 
    270266            $comm .= " --offset $opt->{offset}" if ($opt->{offset}); 
     
    276272        my $retval = 0; 
    277273        if ((defined $opt->{dontcallgrabbers}) && ($opt->{dontcallgrabbers})) { 
    278             &log("SHEPHERD: not calling grabber because of --dontcallgrabbers option, but will instead use existing $output\n"); 
    279             &log("SHEPHERD: would have called: $comm\n") if ($debug); 
     274            printf "SHEPHERD: not calling grabber because of --dontcallgrabbers option, but will instead use existing $output\n"; 
     275            printf "SHEPHERD: would have called: $comm\n" if ($debug); 
    280276        } else { 
    281             &log("SHEPHERD: Excuting command: $comm\n"); 
     277            printf "SHEPHERD: Excuting command: $comm\n"; 
    282278            chdir "$CWD/grabbers/$grabber/"; 
    283279            $retval = call_prog($comm); 
     
    286282 
    287283        if ($retval != 0) { 
    288             &log("grabber returned with non-zero return code $retval: assuming it failed.\n"); 
     284            printf "grabber returned with non-zero return code $retval: assuming it failed.\n"; 
    289285            next; 
    290286        } 
     
    305301            my $list = List::Compare->new($missing_before, $missing_after); 
    306302            my @grabbed = $list->get_symmetric_difference(); 
    307             &log("Grabbed: " . join (', ', @grabbed) . ".\n") if ($debug); 
     303            printf "Grabbed: " . join (', ', @grabbed) . ".\n" if ($debug); 
    308304            record_cached($grabber, @grabbed); 
    309305            write_config_file(); 
     
    316312    if ($used_grabbers == 0) 
    317313    { 
    318         &log("No valid grabbers installed/enabled!\n"); 
     314        printf "No valid grabbers installed/enabled!\n"; 
    319315        return; 
    320316    } 
     
    322318    unless ($grabber_found_all_data) 
    323319    { 
    324         &log("SHEPHERD: Ran through ALL grabbers but still missing data!!! :(\n"); 
     320        printf "SHEPHERD: Ran through ALL grabbers but still missing data!!! :(\n"; 
    325321        return; 
    326322    } 
     
    360356    if ($debug) 
    361357    { 
    362         &log((sprintf "Best timeslice: day%s of channels %s (%d chandays).\n", 
     358        printf "Best timeslice: day%s of channels %s (%d chandays).\n", 
    363359                    ($timeslice->{start} == $timeslice->{stop} ? 
    364360                        " $timeslice->{start}" : 
    365361                        "s $timeslice->{start} - $timeslice->{stop}"), 
    366362                    join(', ', @{$timeslice->{chans}}), 
    367                     $timeslice->{chandays})); 
     363                    $timeslice->{chandays}; 
    368364    } 
    369365 
     
    372368    if ($debug) 
    373369    { 
    374         &log("Grabber selection:\n"); 
     370        printf "Grabber selection:\n"; 
    375371        foreach (sort { $gscore->{$b} <=> $gscore->{$a} } keys %$gscore) 
    376372        { 
     
    383379            if ($opt->{randomize}) 
    384380            { 
    385                 &log((sprintf "%15s %6.1f%% %9s %s\n",  
     381                printf "%15s %6.1f%% %9s %s\n",  
    386382                        $_,  
    387383                        ($total ? 100* $score / $total : 0),  
    388384                        "$score pts", 
    389                         $cstr)); 
     385                        $cstr; 
    390386            } 
    391387            else 
    392388            { 
    393                 &log((sprintf   "%15s %4s pts %s\n",  
     389                printf "%15s %4s pts %s\n",  
    394390                        $_,  
    395391                        $score, 
    396                         $cstr)); 
     392                        $cstr; 
    397393            } 
    398394        } 
     
    413409            unless ($components->{$grabber}->{lastdata}) 
    414410            { 
    415                 &log("Need to build title translation list for transitional grabber $grabber.\n"); 
     411                printf "Need to build title translation list for transitional grabber $grabber.\n"; 
    416412                return select_grabber($grabber, $gscore) if ($gscore->{$grabber}); 
    417                 &log("WARNING: Can't run $grabber to build title translation list!\n"); 
     413                printf "WARNING: Can't run $grabber to build title translation list!\n"; 
    418414            } 
    419415        } 
     
    459455    my ($grabber, $gscore) = @_; 
    460456 
    461     &log("Selected $grabber.\n") if ($debug); 
     457    printf "Selected $grabber.\n" if ($debug); 
    462458    if (query_config($grabber, 'category') == 2) 
    463459    { 
     
    497493        { 
    498494            $key = cut_down_missing($grabber); 
    499             # &log("Grabber $grabber is Category 1: comparing capability to best timeslice.\n") if ($debug); 
     495            # printf "Grabber $grabber is Category 1: comparing capability to best timeslice.\n" if ($debug); 
    500496        } 
    501497        else 
    502498        { 
    503499            $key = $missing; 
    504             # &log("Grabber $grabber is Category 2: comparing capability to all wanted channels and days.\n") if ($debug); 
     500            # printf "Grabber $grabber is Category 2: comparing capability to all wanted channels and days.\n" if ($debug); 
    505501        } 
    506502 
     
    515511                my $val = supports_day($grabber, $day); 
    516512                next unless ($val); 
    517                 # &log("Day $day:") if ($debug); 
     513                # printf "Day $day:" if ($debug); 
    518514                foreach my $ch (@{$key->{$day}}) 
    519515                { 
    520516                    if (supports_channel($grabber, $ch, $day)) 
    521517                    { 
    522                         # &log(" $ch") if ($debug); 
     518                        # printf " $ch" if ($debug); 
    523519                        $hits += $val; 
    524520                    } 
    525521                } 
    526                 # &log("\n") if $debug; 
     522                # printf "\n" if $debug; 
    527523                $hits = 1 if ($hits > 0 and $hits < 1); 
    528524            } 
     
    556552                            $score; 
    557553            } 
    558             &log("$str.\n"); 
     554            printf "$str.\n"; 
    559555        } 
    560556 
     
    586582                $total -= $gscore->{$_}; 
    587583                $gscore->{$_} = 0; 
    588                 &log("Zeroing grabber $_ due to low data quality.\n") if ($debug); 
     584                printf "Zeroing grabber $_ due to low data quality.\n" if ($debug); 
    589585            } 
    590586        } 
     
    611607    unless (defined $channels_supported) 
    612608    { 
    613         &log("WARNING: Grabber $grabber has no channel support " . 
    614               "specified in config.\n"); 
     609        printf "WARNING: Grabber $grabber has no channel support " . 
     610              "specified in config.\n"; 
    615611        $channels_supported = ''; 
    616612    } 
     
    686682    if ($debug) 
    687683    { 
    688         &log("Need data for days " . join(", ", sort keys %$m) .  
    689              " ($chandays chandays).\n"); 
     684        printf "Need data for days " . join(", ", sort keys %$m) .  
     685             " ($chandays chandays).\n"; 
    690686    } 
    691687    return $m; 
     
    737733    my ($grabber, @grabbed) = @_; 
    738734 
    739     &log("Recording cache for grabber $grabber.\n") if ($debug); 
     735    printf "Recording cache for grabber $grabber.\n" if ($debug); 
    740736 
    741737    my $gcache = $components->{$grabber}->{cached}; 
     
    788784    my ($grabber, $slice) = @_; 
    789785 
    790     &log("Recording timeslice request; will not request these chandays " . 
    791          "from $grabber again.\n") if ($debug); 
     786    printf "Recording timeslice request; will not request these chandays " . 
     787         "from $grabber again.\n" if ($debug); 
    792788 
    793789    my @requested; 
     
    848844 
    849845    if (! -r $output) { 
    850         &log((sprintf "SHEPHERD: Warning: plugin '%s' output file '%s' does not exist\n",$plugin,$output)); 
     846        printf "SHEPHERD: Warning: plugin '%s' output file '%s' does not exist\n",$plugin,$output; 
    851847        return; 
    852848    } 
    853849 
    854850    my $this_plugin = $plugin_data->{$plugin}; 
    855     &log((sprintf "SHEPHERD: Started parsing XMLTV from '%s' in '%s' .. any errors below are from parser:\n",$plugin,$output)); 
     851    printf "SHEPHERD: Started parsing XMLTV from '%s' in '%s' .. any errors below are from parser:\n",$plugin,$output; 
    856852    eval { $this_plugin->{xmltv} = XMLTV::parsefiles($output); }; 
    857     &log((sprintf "SHEPHERD: Completed XMLTV parsing from '%s'\n",$plugin)); 
     853    printf "SHEPHERD: Completed XMLTV parsing from '%s'\n",$plugin; 
    858854 
    859855    if (!($this_plugin->{xmltv})) { 
    860         &log("WARNING: Plugin $plugin didn't seem to return any valid XMLTV!\n"); 
     856        printf "WARNING: Plugin $plugin didn't seem to return any valid XMLTV!\n"; 
    861857        return; 
    862858    } 
     
    884880        if (!defined $chan_xml_list{($prog->{channel})}) { 
    885881            $this_plugin->{progs_with_unknown_channel}++; 
    886             &log((sprintf " - WARNING: plugin '%s' returned data for unknown channel '%s': ignored.\n",$plugin,$prog->{channel})); 
     882            printf " - WARNING: plugin '%s' returned data for unknown channel '%s': ignored.\n",$plugin,$prog->{channel}; 
    887883            $chan_xml_list{($prog->{channel})} = 1;     # so we warn only once 
    888884        } 
     
    901897 
    902898            if (!$t1 || !$t2) { 
    903                 &log((sprintf " - WARNING: plugin '%s' returned programme data with invalid timestamp format: \"%s\": can't parse.\n", 
    904                     $plugin,(!$t1 ? $prog->{start} : $prog->{stop}))) if (!$this_plugin->{progs_with_invalid_date}); 
     899                printf " - WARNING: plugin '%s' returned programme data with invalid timestamp format: \"%s\": can't parse.\n", 
     900                    $plugin,(!$t1 ? $prog->{start} : $prog->{stop}) if (!$this_plugin->{progs_with_invalid_date}); 
    905901                $this_plugin->{progs_with_invalid_date}++; 
    906902                next; 
     
    943939 
    944940    # print some stats about what we saw! 
    945     &log((sprintf "SHEPHERD: %s '%s' returned data for %d channels, %d programmes, %dd%02dh%02dm%02ds duration, %s%s\n", 
     941    printf "SHEPHERD: %s '%s' returned data for %d channels, %d programmes, %dd%02dh%02dm%02ds duration, %s%s\n", 
    946942        ucfirst($plugintype), $plugin, $seen_channels_with_data, $this_plugin->{programmes}, 
    947943        int($this_plugin->{total_duration} / 86400),            # days 
     
    950946        int($this_plugin->{total_duration} % 60),               # sec 
    951947        (defined $this_plugin->{earliest_data_seen} ? (strftime "%a %e %b %H:%M - ", localtime($this_plugin->{earliest_data_seen})) : 'no data'), 
    952         (defined $this_plugin->{latest_data_seen} ? (strftime "%a %e %b %H:%M", localtime($this_plugin->{latest_data_seen})) : ''))); 
     948        (defined $this_plugin->{latest_data_seen} ? (strftime "%a %e %b %H:%M", localtime($this_plugin->{latest_data_seen})) : ''); 
    953949 
    954950    $this_plugin->{laststatus} = sprintf "%dch/%dpr/%dhrs %s-%s", 
     
    966962{ 
    967963    my ($analysistype,$quiet) = @_; 
    968     &log("SHEPHERD: $analysistype:\n") unless $quiet; 
     964    printf "SHEPHERD: $analysistype:\n" unless $quiet; 
    969965 
    970966    my $total_channels = 0; 
     
    11081104            } 
    11091105        } 
    1110         &log($statusstring) unless $quiet; 
     1106        printf $statusstring unless $quiet; 
    11111107 
    11121108        delete $channel_data->{$ch}->{analysis} if (defined $channel_data->{$ch}->{analysis}); 
     
    11141110    } 
    11151111 
    1116     &log((sprintf " > OVERALL: %s\n", ($overall_data_ok ? "PASS" : "FAIL"))) unless $quiet; 
     1112    printf " > OVERALL: %s\n", ($overall_data_ok ? "PASS" : "FAIL") unless $quiet; 
    11171113 
    11181114    return $overall_data_ok; # return 1 for good, 0 for need more 
     
    12351231sub reconcile_data 
    12361232{ 
    1237     &log("\nReconciling data:\n\n"); 
     1233    printf "\nReconciling data:\n\n"; 
    12381234 
    12391235    my $num_grabbers = 0; 
     
    12411237    my @input_file_list; 
    12421238 
    1243     &log("Preferred title preferences from '$pref_title_source'\n") 
     1239    printf "Preferred title preferences from '$pref_title_source'\n" 
    12441240        if ((defined $pref_title_source) && 
    12451241            ($plugin_data->{$pref_title_source}) && 
    12461242            ($plugin_data->{$pref_title_source}->{valid})); 
    12471243 
    1248     &log("Preference for whose data we prefer as follows:\n"); 
     1244    printf "Preference for whose data we prefer as follows:\n"; 
    12491245    foreach my $proggy (sort { $components->{$b}->{config}->{quality} <=> $components->{$a}->{config}->{quality} } query_grabbers()) { 
    12501246        if ((!$components->{$proggy}->{disabled}) && ($plugin_data->{$proggy}) && ($plugin_data->{$proggy}->{valid})) { 
    12511247            $num_grabbers++; 
    1252             &log((sprintf "  %d. %s (%s)\n", $num_grabbers, $proggy, $plugin_data->{$proggy}->{output_filename})); 
     1248            printf "  %d. %s (%s)\n", $num_grabbers, $proggy, $plugin_data->{$proggy}->{output_filename}; 
    12531249 
    12541250            $input_files .= $plugin_data->{$proggy}->{output_filename}." "; 
     
    12691265        if ((!$reconciler_found_all_data) && ($grabber_found_all_data)) { 
    12701266            # urgh.  this reconciler did a bad bad thing ... 
    1271             &log("SHEPHERD: XML data from reconciler $reconciler appears bogus, will try to use another reconciler\n"); 
     1267            printf "SHEPHERD: XML data from reconciler $reconciler appears bogus, will try to use another reconciler\n"; 
    12721268        } else { 
    1273             &log("SHEPHERD: Data from reconciler $reconciler looks good\n"); 
     1269            printf "SHEPHERD: Data from reconciler $reconciler looks good\n"; 
    12741270            $input_postprocess_file = $plugin_data->{$reconciler}->{output_filename}; 
    12751271        } 
     
    12801276    if ($input_postprocess_file eq "") { 
    12811277        # no reconcilers worked!! 
    1282         &log("SHEPHERD: WARNING: No reconcilers seemed to work!  Falling back to concatenating the data together!\n"); 
     1278        printf "SHEPHERD: WARNING: No reconcilers seemed to work!  Falling back to concatenating the data together!\n"; 
    12831279 
    12841280        my %w_args = (); 
     
    13041300    # first time around: feed in reconciled data ($input_postprocess_file) 
    13051301 
    1306     &log("\nPostprocessing stage:\n"); 
     1302    printf "\nPostprocessing stage:\n"; 
    13071303 
    13081304    foreach my $postprocessor (sort { $components->{$a} <=> $components->{$b} } query_postprocessors()) { 
     
    13141310        if ($found_all_data) { 
    13151311            # accept what this postprocessor did to our output ... 
    1316             &log("SHEPHERD: accepting output from postprocessor $postprocessor, feeding it into next stage\n"); 
     1312            printf "SHEPHERD: accepting output from postprocessor $postprocessor, feeding it into next stage\n"; 
    13171313            $input_postprocess_file = $plugin_data->{$postprocessor}->{output_filename}; 
    13181314            delete $components->{$postprocessor}->{conescutive_failures} if (defined $components->{$postprocessor}->{conescutive_failures}); 
     
    13211317 
    13221318        # urgh.  this postprocessor did a bad bad thing ... 
    1323         &log("SHEPHERD: XML data from postprocessor $postprocessor rejected, using XML from previous stage\n"); 
     1319        printf "SHEPHERD: XML data from postprocessor $postprocessor rejected, using XML from previous stage\n"; 
    13241320 
    13251321        if (defined $components->{$postprocessor}->{conescutive_failures}) { 
     
    13281324            $components->{$postprocessor}->{conescutive_failures} = 1; 
    13291325        } 
    1330         &log((sprintf "SHEPHERD: Postprocessor \"%s\" has now failed %d times in a row.  %d more and it will be automatically disabled.\n", 
     1326        printf "SHEPHERD: Postprocessor \"%s\" has now failed %d times in a row.  %d more and it will be automatically disabled.\n", 
    13311327            $postprocessor, 
    13321328            $components->{$postprocessor}->{conescutive_failures}, 
    1333             ($policy{postprocessor_disable_failure_threshold} - $components->{$postprocessor}->{conescutive_failures}))); 
     1329            ($policy{postprocessor_disable_failure_threshold} - $components->{$postprocessor}->{conescutive_failures}); 
    13341330 
    13351331        if ($components->{$postprocessor}->{conescutive_failures} >= $policy{postprocessor_disable_failure_threshold}) { 
    1336             &log("SHEPHERD: Disabling Postprocessor \"$postprocessor\".\n"); 
     1332            printf "SHEPHERD: Disabling Postprocessor \"$postprocessor\".\n"; 
    13371333            $components->{$postprocessor}->{disabled} = 1; 
    13381334        } 
     
    13521348    $components->{$data_processor_name}->{laststatus} = "unknown"; 
    13531349 
    1354     &log((sprintf "\nSHEPHERD: Using %s: %s\n",$data_processor_type,$data_processor_name)); 
     1350    printf "\nSHEPHERD: Using %s: %s\n",$data_processor_type,$data_processor_name; 
    13551351 
    13561352    my $output = sprintf "%s/%ss/%s/output.xmltv",$CWD,$data_processor_type,$data_processor_name; 
     
    13711367 
    13721368    $comm .= " $input_files"; 
    1373     &log("SHEPHERD: Excuting command: $comm\n"); 
     1369    printf "SHEPHERD: Excuting command: $comm\n"; 
    13741370 
    13751371    my $dir = sprintf "%s/%ss/%s/",$CWD,$data_processor_type,$data_processor_name; 
     
    13791375 
    13801376    if ($retval != 0) { 
    1381         &log("$data_processor_type returned with non-zero return code $retval: assuming it failed.\n"); 
     1377        printf "$data_processor_type returned with non-zero return code $retval: assuming it failed.\n"; 
    13821378        return 0; 
    13831379    } 
     
    14181414 
    14191415    if (!(open(INFILE,"<$input_postprocess_file"))) { 
    1420         &log((sprintf "WARNING: could not open input file \"%s\": %s\n", $input_postprocess_file, $!)); 
    1421         &log("Output XMLTV data may be damanged as a result!\n"); 
     1416        printf "WARNING: could not open input file \"%s\": %s\n", $input_postprocess_file, $!; 
     1417        printf "Output XMLTV data may be damanged as a result!\n"; 
    14221418    } else { 
    14231419        while (<INFILE>) { 
     
    14281424    } 
    14291425 
    1430     &log("Final output stored in $output_filename.\n"); 
     1426    printf "Final output stored in $output_filename.\n"; 
    14311427} 
    14321428 
     
    14891485} 
    14901486 
    1491 sub open_logfile 
    1492 { 
    1493     printf "Logging to $log_file.\n"; 
    1494     open(LOG_FILE,">>$log_file") || die "can't open log file $log_file for writing: $!\n"; 
    1495  
    1496     my $now = localtime(time); 
    1497     printf LOG_FILE "$progname version $version started at $now\n\n"; 
    1498 } 
    1499  
    1500 sub close_logfile 
    1501 { 
    1502     close(LOG_FILE); 
    1503 } 
    1504  
    1505 sub log 
    1506 { 
    1507     my $entry = shift; 
    1508     print $entry; 
    1509     printf LOG_FILE "%s",$entry unless $opt->{nolog}; 
    1510 } 
    1511  
    15121487sub call_prog 
    15131488{ 
    15141489    my $prog = shift; 
    15151490    if (!(open(PROG,"$prog|"))) { 
    1516         &log("warning: couldn't exec \"$prog\": $!\n"); 
     1491        printf "warning: couldn't exec \"$prog\": $!\n"; 
    15171492        return -1; 
    15181493    } 
    15191494    while(<PROG>) { 
    1520         &log($_); 
     1495        printf $_; 
    15211496    } 
    15221497    close(PROG); 
    15231498 
    15241499    if ($? == -1) { 
    1525         &log("Failed to execute prog: $!\n"); 
     1500        printf "Failed to execute prog: $!\n"; 
    15261501        return -1; 
    15271502    } elsif ($? & 127) { 
    1528         &log((sprintf "prog died with signal %d, %s coredump\n", 
    1529           ($? & 127),  ($? & 128) ? "with" : "without")); 
     1503        printf "prog died with signal %d, %s coredump\n", 
     1504          ($? & 127),  (($? & 128) ? "with" : "without"); 
    15301505        return $?; 
    15311506    } else { 
    1532         &log((sprintf "prog exited with value %d\n", $? >> 8)) if ($debug or $?); 
     1507        printf "prog exited with value %d\n", ($? >> 8) if ($debug or $?); 
    15331508        return ($? >> 8); 
    15341509    } 
     
    16331608              'enable=s'        => \$opt->{enable}, 
    16341609 
    1635               'nolog'           => \$opt->{nolog}, 
    1636  
    16371610              'days=i'          => \$days, 
    16381611              'offset=i'        => \$opt->{offset}, 
     
    16941667    --capabilities        Report capabilities to XMLTV 
    16951668 
    1696     --nolog               Don't write a logfile 
    16971669}; 
    16981670    exit 0; 
     
    17101682    # check if we are in an eval() 
    17111683    if ($^S) { 
    1712         printf STDERR "  shepherd caught a die() within eval{} from file $file line $line\n"; 
     1684        printf "  shepherd caught a die() within eval{} from file $file line $line\n"; 
    17131685    } else { 
    1714             printf STDERR "\nDIE: line %d in file %s\n",$line,$file; 
     1686            printf "\nDIE: line %d in file %s\n",$line,$file; 
    17151687            if ($arg) { 
    17161688                CORE::die($arg,@rest);