in reply to Re: Filehandler Trouble
in thread Filehandler Trouble

Sorry about getting back so late it is getting busier over here. The message doesn't get printed into the eadas.log file by the filehandler LOG. This was puzzling me because my other messages are being printed into the eadas.log file by the filehandler OK. There are no error messages being reported. What would be the best way to check the return values for the calls you mention and so that they can be checked?
open(LOG, ">> $log/eadas.log") or die "Can't open $log/eadas.log: $!\n +"; LOG->autoflush(1);

Replies are listed 'Best First'.
Re^3: Filehandler Trouble
by samtregar (Abbot) on Dec 14, 2004 at 21:47 UTC
    Try this:

    print LOG "foo" or die "Unable to print: $!"; close LOG or die "Unable to close: $!";

    -sam

      Both lines were added and there were no errors being reported but the "foo" didn't get printed into the log file. The last verbage that gets printed is in the below foreach loop. After this section of code it starts making an Excel spreadsheet.
      upd_hash(\%ca, \@ca); upd_hash(\%nv, \@nv); print LOG "$time Completed Processing West XLS Data For $report\n" +; }
        Are you sure the code is being reached? Try sticking this just before the print:

           die("HERE I AM!");

        Now your code should die and you'll know that the line is being reached. Alternately you could pop into the debugger and obtain the same information.

        -sam

Re^3: Filehandler Trouble
by tc1364 (Beadle) on Dec 15, 2004 at 12:02 UTC
    The code was changed to die if there was any trouble with closing or printing to the LOG filehandler and the code never reported any errors but "foo" was never printed into log file by the filehandler.