Re: How to print errors to both STDERR & a file?

2009-06-24 Thread Raymond Wan
Hi Pablo, pa...@compugenic.com wrote: STDERR is where errors go. Error messages are generated as a result of an error, not a 'print' statement. Athough I could manually print to STDERR, I'm trying to log all errors to both a logfile and STDERR. Hm, not quite sure what you mean. Error

Re: How to print errors to both STDERR & a file?

2009-06-24 Thread pablo
On Wed, Jun 24, 2009 at 09:41:10PM +0400, Roman Makurin wrote: > On Wed, Jun 24, 2009 at 09:25:05AM -0700, pa...@compugenic.com wrote: > > I'd like to automatically have my script's errors and warnings sent to > > both STDOUT (console) and a log file. What is the proper way of doing this? > > pri

Re: question about constants

2009-06-24 Thread Jenda Krynicky
Steve Bertrand wrote: > Roman Makurin wrote: > > On Wed, Jun 24, 2009 at 03:25:57PM +0200, Jenda Krynicky wrote: > >> From: Roman Makurin > >>> here is complite perl script which produces such results without > >>> any warning: > >>> > >>> #!/usr/bin/perl > >>> > >>> use strict; > >>> use warning

Re: Getting started

2009-06-24 Thread Telemachus
On Wed Jun 24 2009 @ 2:16, Daryl Styrk wrote: > I've purchased "Learning Perl" to finally give picking up perl a fair > shot. However in the beginning of the book it suggest that I should have > an understanding of basic programming concepts such as variables, loops, > subroutines, and arrays...

Re: friend class in perl

2009-06-24 Thread Jim Gibson
On 6/24/09 Wed Jun 24, 2009 10:45 AM, "Roman Makurin" scribbled: > Hi > > I need create a friend class. Is there any special that I > need to know ? For now, I get object and work with it like > with ordinary reference with direct access to internal > fields. All Perl classes are friends, if

Re: reCaptcha with CGI::Application and HTML::Template help?!?

2009-06-24 Thread Scott
Scott wrote: my $c = Captcha::reCAPTCHA->new; $template->param(CAPTCHA => $c->get_html( 'mypubkeyitookout' )); my $result = $c->check_answer( 'myprivkeyitookout', $ENV{'REMOTE_ADDR'}, my $challenge = $query->param("recaptcha_challenge_field"), my $response

Re: Getting started

2009-06-24 Thread Scott
Daryl Styrk wrote: I've purchased "Learning Perl" to finally give picking up perl a fair shot. However in the beginning of the book it suggest that I should have an understanding of basic programming concepts such as variables, loops, subroutines, and arrays... Well, I don't. I was hoping that

Getting started

2009-06-24 Thread Daryl Styrk
I've purchased "Learning Perl" to finally give picking up perl a fair shot. However in the beginning of the book it suggest that I should have an understanding of basic programming concepts such as variables, loops, subroutines, and arrays... Well, I don't. I was hoping that this book would somew

Re: reCaptcha with CGI::Application and HTML::Template help?!?

2009-06-24 Thread Scott
my $c = Captcha::reCAPTCHA->new; $template->param(CAPTCHA => $c->get_html( 'mypubkeyitookout' )); my $result = $c->check_answer( 'myprivkeyitookout', $ENV{'REMOTE_ADDR'}, my $challenge = $query->param("recaptcha_challenge_field"), my $res

reCaptcha with CGI::Application and HTML::Template help?!?

2009-06-24 Thread Scott
First of all thanks for those that help me with this. I am roughly new to Perl web development so this is a little over my head with this. I am trying to implement ReCaptcha http://search.cpan.org/~andya/Captcha-reCAPTCHA-0.92/lib/Captcha/reCAPTCHA.pm into my registration form that is using Cgi

friend class in perl

2009-06-24 Thread Roman Makurin
Hi I need create a friend class. Is there any special that I need to know ? For now, I get object and work with it like with ordinary reference with direct access to internal fields. Thanks -- If you think of MS-DOS as mono, and Windows as stereo, then Linux is Dolby Digital and all the music

Re: How to print errors to both STDERR & a file?

2009-06-24 Thread Roman Makurin
On Wed, Jun 24, 2009 at 09:25:05AM -0700, pa...@compugenic.com wrote: > I'd like to automatically have my script's errors and warnings sent to > both STDOUT (console) and a log file. What is the proper way of doing this? print STDERR mess; print FILEHANDLE mess; > > Pablo > > -- > To unsubsc

Re: redirecting STDERR with IO::Tee

2009-06-24 Thread pablo
On Wed, Jun 24, 2009 at 05:52:36PM +0800, Jeff Pang wrote: > 2009/6/23 : > > I have a script which runs mostly via a cron job and sometimes > > interactively.  I would like STDERR to automatically print to both the > > console and to a logfile simultaneously. > > Hi, > > What causes writting

How to print errors to both STDERR & a file?

2009-06-24 Thread pablo
I'd like to automatically have my script's errors and warnings sent to both STDOUT (console) and a log file. What is the proper way of doing this? Pablo -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: question about constants

2009-06-24 Thread Steve Bertrand
Roman Makurin wrote: > On Wed, Jun 24, 2009 at 03:25:57PM +0200, Jenda Krynicky wrote: >> From: Roman Makurin >>> here is complite perl script which produces such results without >>> any warning: >>> >>> #!/usr/bin/perl >>> >>> use strict; >>> use warnings; >>> >>> use constant { >>> A => 0, >

Re: question about constants

2009-06-24 Thread John W. Krahn
Jenda Krynicky wrote: But of course this does not print anything. The shift(@a) returns the first element of @a which is zero, assigns that to $i and then checks whether it's true. And of course it's not. So it skips the body and leaves the loop. Keep in mind that the value of my $i = sh

Re: question about constants

2009-06-24 Thread Roman Makurin
On Wed, Jun 24, 2009 at 03:25:57PM +0200, Jenda Krynicky wrote: > From: Roman Makurin > > here is complite perl script which produces such results without > > any warning: > > > > #!/usr/bin/perl > > > > use strict; > > use warnings; > > > > use constant { > > A => 0, > > B => 1, > >

Re: question about constants

2009-06-24 Thread Gunnar Hjalmarsson
Steve Bertrand wrote: Roman Makurin wrote: On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote: Strange. It looks like strictures and warnings are not enabled (@a and @b are not declared). Try to add use strict; use warnings; and see if that makes Perl give you a hi

Re: question about constants

2009-06-24 Thread Jenda Krynicky
From: Roman Makurin > here is complite perl script which produces such results without > any warning: > > #!/usr/bin/perl > > use strict; > use warnings; > > use constant { > A => 0, > B => 1, > C => 2 }; > > my @a = (A, B, C); > my @b = (1, 2, 3); > > while(my $i = shift @a

Re: question about constants

2009-06-24 Thread Steve Bertrand
Roman Makurin wrote: > On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote: >> Strange. >> >> It looks like strictures and warnings are not enabled (@a and @b are not >> declared). Try to add >> >> use strict; >> use warnings; >> >> and see if that makes Perl give you a hin

Re: question about constants

2009-06-24 Thread Roman Makurin
On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote: > Strange. > > It looks like strictures and warnings are not enabled (@a and @b are not > declared). Try to add > > use strict; > use warnings; > > and see if that makes Perl give you a hint. > here is complite perl scri

Re: redirecting STDERR with IO::Tee

2009-06-24 Thread Jeff Pang
2009/6/23 : > I have a script which runs mostly via a cron job and sometimes interactively. >  I would like STDERR to automatically print to both the console and to a > logfile simultaneously. > > Right now I've gotten as far as merging both file handles with IO::Tee but > I'm not sure if I'm h

AW: imap module

2009-06-24 Thread Thomas Bätzler
Andreas Moroder asked: > does a IMAP library exist that supports this functionality: > connect to the IMAP server as administrator and create a mail with a > attachment in the drafts folder of a specified user. > > I searched cpan, but from the documentation I dit not find out if the > libraries d