Permalink
Browse files

Lexical filehandle.

  • Loading branch information...
1 parent 3ee1c02 commit 5c70a8910bfd3e52a10a2d1c3157df0a3e2a3b8f @shlomif shlomif committed with ranguard Sep 17, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/perlfaq9.pod
View
3 lib/perlfaq9.pod
@@ -66,9 +66,10 @@ server error log.
The following use of L<CGI::Carp> also redirects errors to a file of your choice,
placed in a C<BEGIN> block to catch compile-time warnings as well:
+ use vars qw($log_fh);
BEGIN {
use CGI::Carp qw(carpout);
- open(LOG, ">>/var/local/cgi-logs/mycgi-log")
+ open($log_fh, ">>/var/local/cgi-logs/mycgi-log")
or die "Unable to append to mycgi-log: $!\n";
carpout(*LOG);
}

0 comments on commit 5c70a89

Please sign in to comment.