in reply to Re: How do I...Redirect error.log data to a file of my chosing
in thread How do I...Redirect error.log data to a file of my chosing
For some reason, I cannot stand to see it not written as
I just felt I had to share that.BEGIN { use CGI::Carp qw(carpout); carpout(\*LOGGY) if open(LOGGY,'>>'.__FILE__.'.err.log'); }
update: weeeel, S_Shrum, i'd either carpout(\*STDOUT); or make warnings fatal and stick with fatalsToBrowser, like (and this works a little weird)
or more portable (warnings pragma ain't available everywhere)#!/usr/bin/perl use warnings FATAL => qw( all ); warn "hello there"; { # line 4 (notice its in a block) BAREWORD; BAREWORD; BAREWORD; }
or better yet#!/usr/bin/perl $SIG{__WARN__} = sub {die("warning: ",@_)}; warn "hello"; __END__
and maybe#!/usr/bin/perl use CGI::Carp qw( fatalsToBrowser ); use Fatal qw( warn ); use strict; use warnings; warn "hello";
Reccomended reading is warnings, perllexwarn, sigtrap, Perl's Warn and Die Signals.BEGIN { use vars qw( $WARR ); $SIG{__WARN__} = sub { $WARR .= join ' ',(@_),caller(),"\n"; }; } warn "hello"; warn "hooyah"; die "aaah"; # ... END { print "Content-Type: text-html\r\n\r\n <pre> $WARR </pre>"; }
______crazyinsomniac_____________________________ Of all the things I've lost, I miss my mind the most. perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;" |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: How do I...Redirect error.log data to a file of my chosing
by Beatnik (Parson) on Jun 01, 2002 at 10:23 UTC | |
Re: Re: Re: How do I...Redirect error.log data to a file of my chosing
by S_Shrum (Pilgrim) on Jun 03, 2002 at 01:23 UTC |
In Section
Seekers of Perl Wisdom