Re: Warnings::Unused Linux perl

2017-11-06 Thread Martin McCormick
Shlomi Fish writes: > Hi Martin, > > please see https://metacpan.org/release/warnings-unused as well as > http://perl-begin.org/topics/cpan/wrappers-for-distributions/ and > http://perl-begin.org/topics/cpan/ . It should not be hard to install and > your > Linux distr

Re: Warnings::Unused Linux perl

2017-11-06 Thread Martin McCormick
Shlomi Fish writes: > Hi, > > The problem may have been the https://en.wikipedia.org/wiki/Letter_case . > That > module has no uppercase letters. That is exactly what it was. This was as easy as falling off the proverbial log cpanp -i warnings::unused all in lower case im

Re: Warnings::Unused Linux perl

2017-11-06 Thread Shlomi Fish
Hi, On Sun, 05 Nov 2017 18:21:25 -0600 "Martin McCormick" wrote: > Shlomi Fish writes: > > Hi Martin, > > > > please see https://metacpan.org/release/warnings-unused as well as > > http://perl-begin.org/topics/cpan/wrappers-for-distributions/ and > &

Re: Warnings::Unused Linux perl

2017-11-05 Thread Martin McCormick
Shlomi Fish writes: > Hi Martin, > > please see https://metacpan.org/release/warnings-unused as well as > http://perl-begin.org/topics/cpan/wrappers-for-distributions/ and > http://perl-begin.org/topics/cpan/ . It should not be hard to install and > your > Linux distr

Re: Warnings::Unused Linux perl

2017-11-05 Thread Shlomi Fish
On Sun, 05 Nov 2017 16:51:09 -0600 "Martin McCormick" wrote: > Most of the work I did in perl was on a FreeBSD system and not > surprisingly, perl under Linux behaves essentially the same but > one thing I notice is that Warnings::Unused doesn't appear as a > mod

Warnings::Unused Linux perl

2017-11-05 Thread Martin McCormick
Most of the work I did in perl was on a FreeBSD system and not surprisingly, perl under Linux behaves essentially the same but one thing I notice is that Warnings::Unused doesn't appear as a module. It is quite useful in keeping one's code free of clutter so the question is whethe

Re: Warnings when sorting by hashref

2017-04-11 Thread Chris Fedde
I like to define a value subroutine. sub myvalue { return uc($options{$_[0]}->{type} // "") } This particular one returns the empty string ("") if $options{$_[0]}->{type} is undefined. Now the sort becomes: sort {myvalue($a) cmp myvalue($b)} keys %options This code is unteste

Re: Warnings when sorting by hashref

2017-04-11 Thread Jim Gibson
> On Apr 11, 2017, at 6:13 AM, Mike Martin wrote: > > Hi > > I have the following code as an example against a hash of hashes, to sort by > hashrf key > > foreach my $opt (sort {uc($options{$b}->{type}) cmp uc($options{$a}->{type})} > keys %options){ >my $type=$options{$opt}->{vt

Warnings when sorting by hashref

2017-04-11 Thread Mike Martin
Hi I have the following code as an example against a hash of hashes, to sort by hashrf key foreach my $opt (sort {uc($options{$b}->{type}) cmp uc($options{$a}->{type})} keys %options){ my $type=$options{$opt}->{vtype}; $video_type->append_text($type) if defined($type)

Re: warnings in Math::Complex

2017-02-09 Thread Jim Gibson
> On Feb 9, 2017, at 7:39 AM, Simon Bauer wrote: > > Hi, > > when I turn on -W in one of my perl scripts then I get a lot of warnings > concerning Math::Complex > > Prototype mismatch: sub Math::Complex::abs (_) vs none at > /usr/share/perl/5.22/Math/Comple

Re: warnings in Math::Complex

2017-02-09 Thread Andy Bach
On Thu, Feb 9, 2017 at 9:39 AM, Simon Bauer wrote: > when I turn on -W in one of my perl scripts then I get a lot of warnings > concerning Math::Complex > > Prototype mismatch: sub Math::Complex::abs (_) vs none at > /usr/share/perl/5.22/Math/Complex.pm line 667. > Prototype

warnings in Math::Complex

2017-02-09 Thread Simon Bauer
Hi,   when I turn on -W in one of my perl scripts then I get a lot of warnings concerning Math::Complex    Prototype mismatch: sub Math::Complex::abs (_) vs none at /usr/share/perl/5.22/Math/Complex.pm line 667.  Prototype mismatch: sub Math::Complex::sqrt (_) vs none at /usr/share/perl/5.22

Re: carp and cgi warnings

2016-02-20 Thread lee
Uri Guttman writes: > On 02/14/2016 01:09 AM, Uri Guttman wrote: >> On 02/13/2016 02:07 PM, lee wrote: >>> Brock Wilcox writes: >>> >>>> Greetings! >>>> >>>> Could you give an example of these warnings, and even better some >

Re: carp and cgi warnings

2016-02-13 Thread Uri Guttman
On 02/14/2016 01:09 AM, Uri Guttman wrote: On 02/13/2016 02:07 PM, lee wrote: Brock Wilcox writes: Greetings! Could you give an example of these warnings, and even better some minimal code that generates them? Something like this gives you warnings in apaches error.log: #!/usr/bin/perl

Re: carp and cgi warnings

2016-02-13 Thread Uri Guttman
On 02/13/2016 02:07 PM, lee wrote: Brock Wilcox writes: Greetings! Could you give an example of these warnings, and even better some minimal code that generates them? Something like this gives you warnings in apaches error.log: #!/usr/bin/perl # use strict; use warnings; use autodie; use

Re: carp and cgi warnings

2016-02-13 Thread lee
Nathan Hilterbrand writes: > On 02/13/2016 07:33 AM, lee wrote: >> Hi, >> >> is there a way to disable the annoying warnings about carp and cgi which >> cgi programs write to the web-server's log file in a general way rather >> than per program? Same goes

Re: carp and cgi warnings

2016-02-13 Thread lee
Brock Wilcox writes: > Greetings! > > Could you give an example of these warnings, and even better some minimal > code that generates them? Something like this gives you warnings in apaches error.log: #!/usr/bin/perl # use strict; use warnings; use autod

Re: carp and cgi warnings

2016-02-13 Thread Nathan Hilterbrand
On 02/13/2016 07:33 AM, lee wrote: Hi, is there a way to disable the annoying warnings about carp and cgi which cgi programs write to the web-server's log file in a general way rather than per program? Same goes for smartmatch warnings. The log file is overloaded with these useless mes

Re: carp and cgi warnings

2016-02-13 Thread Brock Wilcox
Greetings! Could you give an example of these warnings, and even better some minimal code that generates them? Thanks, --Brock On Feb 13, 2016 8:19 AM, "lee" wrote: > Hi, > > is there a way to disable the annoying warnings about carp and cgi which > cgi programs write t

carp and cgi warnings

2016-02-13 Thread lee
Hi, is there a way to disable the annoying warnings about carp and cgi which cgi programs write to the web-server's log file in a general way rather than per program? Same goes for smartmatch warnings. The log file is overloaded with these useless messages, which makes it difficult to

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-11 Thread Shawn H Corey
On Wed, 10 Dec 2014 17:04:42 -0500 Uri Guttman wrote: > it is called magic goto for that reason. it isn't really a sub call > but a replacement of the current sub with the called one. no stack > work is done and @_ is passed as is. it is very valuable when used > like that but rarely needed. when

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Uri Guttman
On 12/10/2014 04:55 PM, Andy Bach wrote: On Wed, Dec 10, 2014 at 3:21 PM, Uri Guttman > wrote: the way to do that is to modify @_ in the calling routine and then calling the sub with &. in your the win there isn't just sharing the code but the return

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Andy Bach
the "my:" was added later to try and show it was my call of warn, not the system. > but you are calling warn there which may not work that way as it is > builtin. > It is, apparently different. Looked at perldoc for perlipc and perlwarnings and tried &warn; &

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Uri Guttman
On 12/10/2014 04:14 PM, Andy Bach wrote: my $ho; my $warning_occured = 0; #my $default_warn = $SIG{__WARN__}; $SIG{__WARN__} = sub { $warning_occured = 1; warn("my: ", @_); }; print $ho; if ($warning_occured) { print "sent warning\n";# Code to run if a warning occur

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Andy Bach
sub at $SIG{__WARN__} so $default_warn is undef. If you define a SIG{__WARN__}, it takes over for the normal handler, which is still available via "warn()" use warnings; my $ho; my $warning_occured = 0; #my $default_warn = $SIG{__WARN__}; $SIG{__WARN__} = sub {

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread nosettle
s There a Way to Make Uninitialized Warnings Fatal? Nathan Hilterbrand writes: > Just firing from memory here... That was extremely good from memory. I tried the code and it just worked except for one line which appears that it should cause the warning to be printed since we are catching a sign

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Martin G. McCormick
Nathan Hilterbrand writes: > Just firing from memory here... That was extremely good from memory. I tried the code and it just worked except for one line which appears that it should cause the warning to be printed since we are catching a signal and probably need to recreate the warning by feeding

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Martin G. McCormick
Nathan Hilterbrand writes: > Just firing from memory here... > > my $warning_occured = 0; > my $default_warn = $SIG{__WARN__}; > $SIG{__WARN__} = sub { > $warning_occured = 1; > $default_warn(@_); > } > > Then in later code: > if ($warning_occured) { > # Code to run if a w

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Shawn H Corey
On Wed, 10 Dec 2014 11:32:16 -0600 "Martin G. McCormick" wrote: > it made me wonder if there is a way to cause a perl program > to die if that condition exists? See `perldoc warnings` and search for /Fatal Warnings/ http://perldoc.perl.org/warnings.html#Fatal-Warnings -- Don&

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Nathan Hilterbrand
On 12/10/2014 12:32 PM, Martin G. McCormick wrote: We've all seen and probably pounded the table a few times when that "Use of uninitialized value" warning pops up. Recently a worker in our group ran a script I wrote and got that warning due to an unforeseen circumstance. Unfortu

Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Martin G. McCormick
We've all seen and probably pounded the table a few times when that "Use of uninitialized value" warning pops up. Recently a worker in our group ran a script I wrote and got that warning due to an unforeseen circumstance. Unfortunately since the script continues to run, the caller w

Re: Stopping undefined warnings

2014-06-23 Thread SSC_perl
I just realized that I can add no warnings 'uninitialized'; to the entire script, which probably makes my last question moot. Unless there's an answer that someone likes better, just disregard that question. I can't think straight with this cold. Not t

Re: Stopping undefined warnings

2014-06-23 Thread SSC_perl
hat's going to be a lot of extra work. Does anyone know of a way to suppress all uninitialized warnings to the log? That way, I wouldn't have to add extra code throughout the script just to stop those. CGI::Carp allows you to send 'fatalsToBrowser' but I can

Re: Stopping undefined warnings

2014-06-17 Thread Andy Bach
pyTempFile('image'); > } > > > I find that much more readable and will not generate any undefined > warnings. > Well, it might if {form} is a missing level: $ cat /tmp/h.pl #!perl use strict; use warnings; my $global ; $global->{ form} = {image_upload => "image&q

Re: Stopping undefined warnings

2014-06-17 Thread Jim Gibson
On Jun 17, 2014, at 1:02 PM, SSC_perl wrote: > What's the best way to stop undefined warnings for code like this: > > $data->{'image'} = CopyTempFile('image') if ($main::global->{'admin'} && > $main::global->{'form

Stopping undefined warnings

2014-06-17 Thread SSC_perl
What's the best way to stop undefined warnings for code like this: $data->{'image'} = CopyTempFile('image') if ($main::global->{'admin'} && $main::global->{'form'}->{'image_upload'} ne '');

Re: suppress the warnings output

2014-05-20 Thread 'lesleyb'
On Tue, May 20, 2014 at 01:51:44PM +0400, Yonghua Peng wrote: > Hi, > > I have resolved the problem by adding a PrintError => 0 when creating the > $dbh object. > > my $success = try { >      $dbh = DBI->connect("dbi:mysql:database=$db;host=$host;port=$port", > $user, $passwd, {RaiseError=>1,P

Re: suppress the warnings output

2014-05-20 Thread Yonghua Peng
Hi, I have resolved the problem by adding a PrintError => 0 when creating the $dbh object. my $success = try {      $dbh = DBI->connect("dbi:mysql:database=$db;host=$host;port=$port", $user, $passwd, {RaiseError=>1,PrintError=>0} ) or croak $DBI::errstr;     1; } catch {     _write_log($_);  

suppress the warnings output

2014-05-19 Thread Yonghua Peng
Hello members, I wrote the code like below: try {      $dbh = DBI->connect("dbi:mysql:database=$db;host=$host;port=$port", $user, $passwd) or croak $DBI::errstr; } catch {     if ($_) {         write_log($_);         exit 1;     } }; The problem is, when the connection fails, it write the erro

Re: Importing subs + strict and warnings using Exporter

2014-03-31 Thread Octavian Rasnita
From: "Ruud H.G. van Tol" > On 2014-03-30 19:10, Octavian Rasnita wrote: >> From: "Dr.Ruud" >> >>> On 2014-03-30 12:26, Octavian Rasnita wrote: >>> >>>> But I also want that module to export strict and warnings. >>> >

Re: Importing subs + strict and warnings using Exporter

2014-03-30 Thread Ruud H.G. van Tol
On 2014-03-30 19:10, Octavian Rasnita wrote: From: "Dr.Ruud" On 2014-03-30 12:26, Octavian Rasnita wrote: But I also want that module to export strict and warnings. http://search.cpan.org/perldoc?Modern%3A%3APerl Thanks. I know about it but it is not helpful. How unimaginati

Re: Importing subs + strict and warnings using Exporter

2014-03-30 Thread Octavian Rasnita
From: "Dr.Ruud" On 2014-03-30 12:26, Octavian Rasnita wrote: But I also want that module to export strict and warnings. http://search.cpan.org/perldoc?Modern%3A%3APerl -- Ruud Thanks. I know about it but it is not helpful. I want to use in my scripts just: use MyModule;

Re: Importing subs + strict and warnings using Exporter

2014-03-30 Thread Dr.Ruud
On 2014-03-30 12:26, Octavian Rasnita wrote: But I also want that module to export strict and warnings. http://search.cpan.org/perldoc?Modern%3A%3APerl -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http

Importing subs + strict and warnings using Exporter

2014-03-30 Thread Octavian Rasnita
Hello, I am trying to create a module that exports a few subroutines in the script that uses it. This is OK, very simple to do using Exporter. But I also want that module to export strict and warnings. If I don't use Exporter in the module, I can make it to export strict and warnings,

Re: Perl error codes and warnings

2013-05-29 Thread *Shaji Kalidasan*
o God. --- From: Warren James - jawarr To: '*Shaji Kalidasan*' ; timothy adigun <2teezp...@gmail.com>; Charles DeRykus Cc: Perl Beginners Sent: Wednesday, 29 May 2013 7:38 PM Subject: RE: Perl error codes and warnings Shaji - Upo

RE: Perl error codes and warnings

2013-05-29 Thread Warren James - jawarr
Shaji - Upon completion, is this something which you could please consider providing to us/the list audience as well?: "...a document with suitable code snippets which includes the most common Perl programming errors and warnings." THANKS JJW From: *Shaji Kalidasan* [mail

Re: Perl error codes and warnings

2013-05-29 Thread *Shaji Kalidasan*
ience in Perl) and I am in the process of preparing a document with suitable code snippets which includes the most common Perl programming errors and warnings. Your valuable input is highly appreciated and I cherish the treasure which I learned from you.   best,

Re: Perl error codes and warnings

2013-05-28 Thread timothy adigun
Hi Shaji, On Wed, May 29, 2013 at 4:19 AM, *Shaji Kalidasan* wrote: > Greetings, > > Where can I get more information on Perl's most common error codes? Is > there a single source (repository/resource) for such most frequently > encountered error codes? > > [code-1] &g

Re: Perl error codes and warnings

2013-05-28 Thread Charles DeRykus
On 5/28/2013 8:19 PM, *Shaji Kalidasan* wrote: Greetings, Where can I get more information on Perl's most common error codes? Is there a single source (repository/resource) for such most frequently encountered error codes? [code-1] use strict; use warnings; [ ... ] The warning

Perl error codes and warnings

2013-05-28 Thread *Shaji Kalidasan*
Greetings, Where can I get more information on Perl's most common error codes? Is there a single source (repository/resource) for such most frequently encountered error codes? [code-1] use strict; use warnings; my @names = qw/bat, ball, %&!*, king, (^@), eagle, zebra/; foreac

Re: How to install non-most recent versions of the module "warnings"

2013-05-09 Thread timothy adigun
Hi Dariusz, On Thu, May 9, 2013 at 8:13 PM, Dariusz Dolecki wrote: > I am getting an error while running cpan>install warnings, I have the > latest stable release of perl. > You don't have to install warnings is already installed for you, when perl was installed. > > cp

Re: How to install non-most recent versions of the module "warnings"

2013-05-09 Thread David Precious
On Thu, 9 May 2013 14:13:27 -0500 Dariusz Dolecki wrote: > I am getting an error while running cpan>install warnings, I have the > latest stable release of perl. 'warnings' isn't a CPAN module, it's a pragma, part of the core Perl distribution, you should not need t

How to install non-most recent versions of the module "warnings"

2013-05-09 Thread Dariusz Dolecki
I am getting an error while running cpan>install warnings, I have the latest stable release of perl. cpan[1]> install warnings Reading '/root/.cpan/Metadata' Database was generated on Wed, 08 May 2013 07:17:03 GMT Running install for module 'warnings' The most re

Re: no warnings inside a loop

2013-04-03 Thread Rob Dixon
On 04/04/2013 00:29, Angela Barone wrote: I'm just curious about this. If you put "no warnings" inside a loop, is it good only for that loop, or will it be in effect until the end of the script? Also see `perllexwarn` Rob -- To unsubscribe, e-mail: beginners-unsubscr.

Re: no warnings inside a loop

2013-04-03 Thread Rob Dixon
On 04/04/2013 00:29, Angela Barone wrote: I'm just curious about this. If you put "no warnings" inside a loop, is it good only for that loop, or will it be in effect until the end of the script? Hi Angela The `warnings` pragma is *lexically* scoped. That means it applies

Re: no warnings inside a loop

2013-04-03 Thread Charles DeRykus
On Wed, Apr 3, 2013 at 4:29 PM, Angela Barone wrote: > I'm just curious about this. If you put "no warnings" inside a > loop, is it good only for that loop, or will it be in effect until the end > of the script? > See: perldoc perllexwarn >From above

Re: no warnings inside a loop

2013-04-03 Thread Jim Gibson
On Apr 3, 2013, at 4:29 PM, Angela Barone wrote: > I'm just curious about this. If you put "no warnings" inside a loop, > is it good only for that loop, or will it be in effect until the end of the > script? 'no warnings' is lexically scoped, meaning

Re: no warnings inside a loop

2013-04-03 Thread Brian Fraser
On Wed, Apr 3, 2013 at 8:29 PM, Angela Barone wrote: > I'm just curious about this. If you put "no warnings" inside a > loop, is it good only for that loop, or will it be in effect until the end > of the script? > > Only for the loop -- warnings, along w

no warnings inside a loop

2013-04-03 Thread Angela Barone
I'm just curious about this. If you put "no warnings" inside a loop, is it good only for that loop, or will it be in effect until the end of the script? Thanks, Angela A2 Hosting now has Perl 5.10.1 http://www.a2hosting.com/1250.html -- To unsubscribe, e-mail: beg

RE: variable definition error not caught when using strict and warnings

2012-11-09 Thread Nemana, Satya
From: Rob Dixon [rob.di...@gmx.com] Sent: 09 November 2012 17:17 To: beginners@perl.org Cc: Nemana, Satya Subject: Re: variable definition error not caught when using strict and warnings On 09/11/2012 17:08, Nemana, Satya wrote: > Hi > > I am

Re: variable definition error not caught when using strict and warnings

2012-11-09 Thread Rob Dixon
On 09/11/2012 17:08, Nemana, Satya wrote: Hi I am a little confused with this program Program: use strict; use warnings; if ($999 == 1056) { print ("\nequal"); } else { print ("\nnot equal"); } What I expect: Perl to throw me an error as $999 variable is no

Re: variable definition error not caught when using strict and warnings

2012-11-09 Thread Andy Bach
storage - in this case, your asking for what was saved by 999th set of capture parens - try: use strict; use warnings; "1056" =~ /(\d+)/; if ($1 == 1056) { print ("equal\n"); } else { print ("not equal\n"); } -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: variable definition error not caught when using strict and warnings

2012-11-09 Thread Robert Wohlfarth
On Fri, Nov 9, 2012 at 11:08 AM, Nemana, Satya wrote: > Program: > use strict; > use warnings; > > if ($999 == 1056) > { > print ("\nequal"); > } > else > { > print ("\nnot equal"); > } > > What I expect: Perl to throw me an

variable definition error not caught when using strict and warnings

2012-11-09 Thread Nemana, Satya
Hi I am a little confused with this program Program: use strict; use warnings; if ($999 == 1056) { print ("\nequal"); } else { print ("\nnot equal"); } What I expect: Perl to throw me an error as $999 variable is not defined, but perl executes the code with a war

Re: Use of uninitialized value warnings

2011-06-06 Thread Uri Guttman
> "CN" == Chris Nehren writes: CN> On Wed, Jun 01, 2011 at 12:00:36 -0400 , Uri Guttman wrote: >> also the use of // for defined or is relatively recent in perl. be >> careful when using it as it may not work in the version you have >> installed or in production. CN> Relatively rec

Re: Use of uninitialized value warnings

2011-06-06 Thread Chris Nehren
On Wed, Jun 01, 2011 at 12:00:36 -0400 , Uri Guttman wrote: > also the use of // for defined or is relatively recent in perl. be > careful when using it as it may not work in the version you have > installed or in production. Relatively recent meaning 3.5 years old, and released in a version of pe

Re: Use of uninitialized value warnings

2011-06-01 Thread Uri Guttman
> "aa" == am0c am0c writes: aa> If you use aa> $log = $log || ''; that should be $log ||= '' ; aa> instead of aa> $log = defined $log ? $log : ''; aa> It might yield a problem because when $log is "0" it is defined but aa> false in boolean context. aa> The correct shorte

Re: Use of uninitialized value warnings

2011-06-01 Thread am0c am0c
If you use $log = $log || ''; instead of $log = defined $log ? $log : ''; It might yield a problem because when $log is "0" it is defined but false in boolean context. The correct shorter version is: $log = $log // ''; And in the line 696: > 696 my ($log, $pass) = $main::global->{login

Re: Use of uninitialized value warnings

2011-05-31 Thread sono-io
esult being undefined. =:\ After I defined them as you mentioned, the warnings went away. Thanks again, Marc -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Use of uninitialized value warnings

2011-05-31 Thread Jim Gibson
t;{form}->{'ud'} = Encrypt($main::global->{form}->{'ud'}, > $main::global->{config}->{'cookie'}); > 699 } > > These warnings are showing up in the log: > > € Use of uninitialized value $log in concatenation (.) or string at line 697 &g

Use of uninitialized value warnings

2011-05-31 Thread sono-io
>{form}->{'userpass'}) : (); 697 $main::global->{form}->{'ud'} = "%%$main::global->{uid}%%$log%%$pass%%".time(); 698 $main::global->{form}->{'ud'} = Encrypt($main::global->{form}->{'ud'}, $main::global->{config}->{&

Warnings

2009-03-09 Thread Gunnar Hjalmarsson
Jerald Sheets wrote: On Mar 8, 2009, at 1:29 PM, Ron Bergin wrote: On Mar 4, 4:46 am, que...@gmail.com (Jerald Sheets) wrote: #!/usr/bin/perl -w It's better to use the warnings pragma, instead of the -w switch ... on the -w switch, here are Damian's words: 18.8. Warnings A

Re: Difference between "perl -w" and "use warnings" in perl !

2008-09-01 Thread Dr.Ruud
"Amit Saxena" schreef: > What's the difference between "perl -w" and "use warnings" in perl ? The -w is the old fashioned way, but still fine for one liners. > If there is no difference, There is an important difference, see warnings and perllexwarn.

Re: Difference between "perl -w" and "use warnings" in perl !

2008-09-01 Thread Rob Dixon
Amit Saxena wrote: > > It's a requirement from the client side, according to them as only > "good" code gets submitted from development environment to the > production environment, they don't need "use warnings" and also "perl > -w" a

Re: Difference between "perl -w" and "use warnings" in perl !

2008-09-01 Thread Amit Saxena
On Mon, Sep 1, 2008 at 6:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Amit Saxena wrote: > > > > What's the difference between "perl -w" and "use warnings" in perl ? > > > > If there is no difference, then the "use warnings" can

Re: Difference between "perl -w" and "use warnings" in perl !

2008-09-01 Thread Rob Dixon
Amit Saxena wrote: > > What's the difference between "perl -w" and "use warnings" in perl ? > > If there is no difference, then the "use warnings" can be removed from the > perl programs and replace them with "perl -w".of removing &qu

Re: Difference between "perl -w" and "use warnings" in perl !

2008-09-01 Thread John W. Krahn
Amit Saxena wrote: Hi all, Hello, What's the difference between "perl -w" and "use warnings" in perl ? perldoc perllexwarn perldoc warnings John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools

Difference between "perl -w" and "use warnings" in perl !

2008-09-01 Thread Amit Saxena
Hi all, What's the difference between "perl -w" and "use warnings" in perl ? If there is no difference, then the "use warnings" can be removed from the perl programs and replace them with "perl -w".of removing "use warnings". Thanks & Regards, Amit Saxena

Re: perl warnings

2008-03-17 Thread Justin Hawkins
On 17 Mar 2008, at 21:58, Gunnar Hjalmarsson wrote: In this case, if I understand it correctly, the default version of the page, with a form, would appear. Why would that be a problem for anybody but the stupid user? ;-) Fundamentally, don't make it possible for your users to do anything

Re: perl warnings

2008-03-17 Thread Gunnar Hjalmarsson
Paul Lalli wrote: On Mar 17, 2:46 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: if ( ! $action ) {...} That'll work great until some jackass puts "?action=0" in the URL. So what? If you put random crap in the URL, you can't reasonably expect a meaningful response. In this case,

Re: perl warnings

2008-03-17 Thread Kashif Salman
gt; > > elsif ($action eq "submit") {...} > > > > > the elsif runs if I hit a button on a form which has a hidden field > > > that sets action="submit". My question is that the script produces a > > > warning on the if statement "

Re: perl warnings

2008-03-17 Thread Paul Lalli
hidden field > > that sets action="submit". My question is that the script produces a > > warning on the if statement " Use of uninitialized value in string eq > > ". How can I get rid of that without using "no warnings". I tried 'if > > (def

Re: perl warnings

2008-03-17 Thread Paul Lalli
on is that the script produces a > warning on the if statement " Use of uninitialized value in string eq > ". How can I get rid of that without using "no warnings". I tried 'if > (defined("$action"))' but that still produces a warning. perldoc -q

Re: perl warnings

2008-03-17 Thread John W. Krahn
nd do my things if ($aciton eq "") {...} elsif ($action eq "submit") {...} the elsif runs if I hit a button on a form which has a hidden field that sets action="submit". My question is that the script produces a warning on the if statement " Use of uninitializ

Re: perl warnings

2008-03-17 Thread Kashif Salman
if runs if I hit a button on a form which has a hidden field > > that sets action="submit". My question is that the script produces a > > warning on the if statement " Use of uninitialized value in string eq > > ". How can I get rid of that without using

Re: perl warnings

2008-03-17 Thread Gunnar Hjalmarsson
($aciton eq "") {...} elsif ($action eq "submit") {...} the elsif runs if I hit a button on a form which has a hidden field that sets action="submit". My question is that the script produces a warning on the if statement " Use of uninitialized value in string

Re: perl warnings

2008-03-17 Thread yitzle
I think you want: if( defined $q->param('action') ) { } else { } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

perl warnings

2008-03-17 Thread Kashif Salman
"") {...} elsif ($action eq "submit") {...} the elsif runs if I hit a button on a form which has a hidden field that sets action="submit". My question is that the script produces a warning on the if statement " Use of uninitialized value in string eq ". How can

Re: Getopt::Std and warnings

2007-12-14 Thread reader
opts stuff than Std and Long. Looks like `Getopt::Easy' might merit trying. Says it has quite a few ways to make it output errors or warnings.. The only drawback, just from reading the synopsis, appears to be that few of the letters are spoken for, depending on what Getopt::Easy you set.

Re: Getopt::Std and warnings

2007-12-14 Thread John W . Krahn
On Friday 14 December 2007 09:09, [EMAIL PROTECTED] wrote: > > I want a warning message without having to do special coding with > Getopt::Std. Getopt is one of those itches that a lot of people have felt like scratching: http://search.cpan.org/search?query=getopt&mode=module If Getopt::Std or

Getopt::Std and warnings

2007-12-14 Thread reader
c Doesn't give any warnings. The code passed: `$optstr ="abc:"' does indicate there should be an accompanying argument with opt_c The code is kind of silly but in addition to seeing what would happen when -c was not given an argument... I was also checking what happened to any

Re: Pragmas use strict and use warnings

2007-10-31 Thread Jenda Krynicky
On 31 Oct 2007 at 4:17, Paul Lalli wrote: > On Oct 30, 5:24 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > > On 30 Oct 2007 at 10:22, Paul Lalli wrote: > > > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > > snip> Wh

Re: Pragmas use strict and use warnings

2007-10-31 Thread Paul Lalli
On Oct 30, 5:24 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > On 30 Oct 2007 at 10:22, Paul Lalli wrote: > > > > > > > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > snip> Whats the exact purpose of use strict > > >

Re: Pragmas use strict and use warnings

2007-10-31 Thread Paul Lalli
On Oct 30, 2:23 pm, [EMAIL PROTECTED] (Kevin Viel) wrote: > > -Original Message- > > From: Paul Lalli [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, October 30, 2007 12:23 PM > > To: [EMAIL PROTECTED] > > Subject: Re: Pragmas use strict and use warnings &g

Re: Pragmas use strict and use warnings

2007-10-31 Thread [EMAIL PROTECTED]
On Oct 30, 9:24 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > On 30 Oct 2007 at 10:22, Paul Lalli wrote: > > > > > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > snip> Whats the exact purpose of use strict > > > > sn

RE: Pragmas use strict and use warnings

2007-10-30 Thread Kevin Viel
> -Original Message- > From: Paul Lalli [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 30, 2007 12:23 PM > To: beginners@perl.org > Subject: Re: Pragmas use strict and use warnings > ...no lexical with that name... ^^^ > ...to declare a

Re: Pragmas use strict and use warnings

2007-10-30 Thread Jenda Krynicky
On 30 Oct 2007 at 10:22, Paul Lalli wrote: > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > snip> Whats the exact purpose of use strict > > > > snip > > > > The strict pragma has three effects (unless modified by arguments

Re: Pragmas use strict and use warnings

2007-10-30 Thread Paul Lalli
On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > snip> Whats the exact purpose of use strict > > snip > > The strict pragma has three effects (unless modified by arguments): > 1. most variables must be declared (there are some e

Re: Pragmas use strict and use warnings

2007-10-30 Thread Chas. Owens
On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: snip > Whats the exact purpose of use strict snip The strict pragma has three effects (unless modified by arguments): 1. most variables must be declared (there are some exceptions) 2. only real references are allowed (symbolic references are

Pragmas use strict and use warnings

2007-10-30 Thread Kaushal Shriyan
Hi Whats the exact purpose of use strict and use warnings Pragmas in the Perl Programming Language. I know use warnings turns on all useful warnings. Thanks and Regards Kaushal

  1   2   3   >