Re: Logging STDERR and other output

2007-09-01 Thread Peter Scott
On Thu, 30 Aug 2007 10:57:20 -0300, Adriano Ferreira wrote: > On 8/30/07, Peter Scott <[EMAIL PROTECTED]> wrote: >> Why are you using a BEGIN block? Why not just make it the first >> executable statement? Do you have any other 'use' statements in the >> program? > > Because otherwise it would be

Re: Logging STDERR and other output

2007-09-01 Thread Peter Scott
On Thu, 30 Aug 2007 17:25:28 +0100, Beginner wrote: > On 30 Aug 2007 at 10:07, Mumia W. wrote: > >> On 08/30/2007 09:37 AM, Beginner wrote: >> > q2) Will our $logfile now be a shared variable across all my modules? >> Try it and see. > > No. It's not. Yes. It is. It was declared (three posts

Re: Logging STDERR and other output

2007-08-31 Thread Dr.Ruud
"Beginner" schreef: > Log::Handler looks pretty comprehensive. Consider also Log::Log4Perl. http://search.cpan.org/~mschilli/Log-Log4perl/lib/Log/Log4perl/FAQ.pm -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Logging STDERR and other output

2007-08-31 Thread Dr.Ruud
"Beginner" schreef: > Adriano Ferreira: >> use lib qw(/etc/perl); > > use lib ('/etc/perl'); The idiom adivised by Adriano is more flexible. See `perldoc lib`. Example: use lib qw( /usr/local/cvs_tree/lib /etc/perl ); -- Affijn, Ruud "Gewoon is een tijger."

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 10:07, Mumia W. wrote: > On 08/30/2007 09:37 AM, Beginner wrote: > > [...] > > > > I tried the INIT option and that worked also and I liked the fact > > that my `perl -c myscript.pl` sent it's output to screen and not my > > log file and I can use a scalar for logfile. > > >

Re: Logging STDERR and other output

2007-08-30 Thread Mumia W.
On 08/30/2007 09:37 AM, Beginner wrote: [...] I tried the INIT option and that worked also and I liked the fact that my `perl -c myscript.pl` sent it's output to screen and not my log file and I can use a scalar for logfile. q1) Does this still give me the effect of getting any errors from t

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 10:59, Adriano Ferreira wrote: > On 8/30/07, Beginner wrote: > > > > BEGIN { unshift @INC, '/etc/perl'; > > This is better done with > > use lib qw(/etc/perl); use lib ('/etc/perl'); Well that seems to work :-). > which doesn't need the surrounding "BEGIN" block. > > >

Re: Logging STDERR and other output

2007-08-30 Thread Adriano Ferreira
On 8/30/07, Beginner <[EMAIL PROTECTED]> wrote: > On 30 Aug 2007 at 6:32, Peter Scott wrote: > > > On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: > > > I want all the output plus any error messages to got to a log file. I > > > used the BEGIN block to direct STDERR into the file: > > > > > > B

Re: Logging STDERR and other output

2007-08-30 Thread Adriano Ferreira
On 8/30/07, Peter Scott <[EMAIL PROTECTED]> wrote: > On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: > > I want all the output plus any error messages to got to a log file. I > > used the BEGIN block to direct STDERR into the file: > > > > BEGIN { > > open(STDERR, ">>/usr/local/myreports/

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 6:32, Peter Scott wrote: > On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: > > I want all the output plus any error messages to got to a log file. I > > used the BEGIN block to direct STDERR into the file: > > > > BEGIN { > > open(STDERR, ">>/usr/local/myreports/repo

Re: Logging STDERR and other output

2007-08-30 Thread Peter Scott
On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: > I want all the output plus any error messages to got to a log file. I > used the BEGIN block to direct STDERR into the file: > > BEGIN { > open(STDERR, ">>/usr/local/myreports/report.log") || die "Can't > write to file: $!\n"; > } > >

Re: Logging STDERR and other output

2007-08-30 Thread Mumia W.
On 08/30/2007 04:32 AM, Beginner wrote: Hi, I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, ">>/usr/local/myreports/report.log") || die "Can't write to file: $!\n"; } use strict; use war

Logging STDERR and other output

2007-08-30 Thread Beginner
Hi, I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, ">>/usr/local/myreports/report.log") || die "Can't write to file: $!\n"; } use strict; use warnings; ... ### Start some logging ### my $lo