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 warning.(I don't expect the

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 snem...@sonusnet.com wrote: 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

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

2012-11-09 Thread Andy Bach
On Fri, Nov 9, 2012 at 11:08 AM, Nemana, Satya snem...@sonusnet.com wrote: 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 warning.(I don't expect

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 not defined, but perl executes

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 a little

Re: need some help using strict??

2007-04-28 Thread Randal L. Schwartz
FamiLink == FamiLink Admin [EMAIL PROTECTED] writes: FamiLink I am trying to verify a credit card number format with the following: (below) FamiLink but I am getting errors like: Why not just use Business::CreditCard? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777

need some help using strict??

2007-04-27 Thread FamiLink Admin
I am trying to verify a credit card number format with the following: (below) but I am getting errors like: Global symbol %r requires explicit package name at ./modmember.cgi line 681. Global symbol %r requires explicit package name at ./modmember.cgi line 683. Global symbol %r requires

Re: need some help using strict??

2007-04-27 Thread Tom Phoenix
On 4/27/07, FamiLink Admin [EMAIL PROTECTED] wrote: I am trying to verify a credit card number format with the following: (below) but I am getting errors like: Global symbol %r requires explicit package name at ./modmember.cgi line 681. This is because, under 'use strict', you must declare

not using strict problems

2005-08-19 Thread Brent Clark
Hi list I have a problem whereby another new programmer (like myself) likes NOT to use strict in his code where by I do. The problem is that I have is that he as writting a pm file and basically just did is as so: use pm file somename; sub somename { $var1 = $linex[0];

Re: not using strict problems

2005-08-19 Thread tmatsumoto
Hi Brent, it shouldn't be a problem the way he wrote the pm, unless he doesn't 'return' anything in the subroutines. I had a similar problem having to convert a pm and the script I was using into 'strict'. I values that I could use between the pm and the script when 'strict' was off

RE: not using strict problems

2005-08-19 Thread Ryan Frantz
-Original Message- From: Brent Clark [mailto:[EMAIL PROTECTED] Sent: Friday, August 19, 2005 3:40 AM To: Beginners Perl Subject: not using strict problems Hi list I have a problem whereby another new programmer (like myself) likes NOT to use strict in his code where by I do

Re: not using strict problems

2005-08-19 Thread JupiterHost.Net
I have a problem whereby another new programmer (like myself) likes NOT to use strict in his code where by I do. My own anecdote: I didn't think that using the 'strict' or 'warnings' pragmas was important either, once. And I'm a very novice programmer. However, when I thought about, I

RE: not using strict problems

2005-08-19 Thread Charles K. Clarkson
Brent Clark mailto:[EMAIL PROTECTED] wrote: : Hi list : : I have a problem whereby another new programmer (like myself) : likes NOT to use strict in his code where by I do. : : The problem is that I have is that he as writting a pm file and : basically just did is as so: [snipped code] One

Having trouble using strict

2005-02-08 Thread Nicolay Vasiliev
with using 'strict' pragma I get error message - $var1 is unknown for this script of course because 'strict' is on; I must declare this with my. But in this case I hade the value of this variable. How could I solve this trouble? Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED

RE: Having trouble using strict

2005-02-08 Thread Moon, John
Subject: Having trouble using strict Hello there! I got a trouble (I think). I'd like to store some variables in a separated file ie vars.pl to have a possibility of using them in different scripts by 'require vars.pl'. So if I use some script using the variable $var1 = somevalue storing

Re: Having trouble using strict

2005-02-08 Thread Nicolay Vasiliev
Oh, I got the main direction, thank you very much! John Moon wrote: Subject: Having trouble using strict Hello there! I got a trouble (I think). I'd like to store some variables in a separated file ie vars.pl to have a possibility of using them in different scripts by 'require vars.pl'. So if I

RE: using strict

2004-04-05 Thread Guay Jean-Sbastien
I am sorry David, it just seems like I am having trouble communicating clearly. We are apparently in a disagreement, but your points are not at all what I wanted to explain... I'll try again. you should test it yourself. i am not sure how good you are with Perl and i don't want to sound like

RE: using strict

2004-04-05 Thread Guay Jean-Sébastien
Hello Joseph, One thing I would request is that you trim off any material to which you are not responding from old posts. This helps keep bandwidth and storage needs down. I'll keep that in mind. I usually don't keep all the thread of replies that Outlook ( grrr) keeps at the bottom, seems

RE: using strict

2004-04-05 Thread Guay Jean-Sébastien
Hello Joseph, David, A stronger argument has to do with mindset. The || operator is an expression evaluation operator, appropriate to mathematical or paramathematical expressions. The context really calls for a flow-control operator, or. Thanks for making my point better than I could,

RE: using strict

2004-04-05 Thread david
Guay Jean-Sbastien wrote: I am sorry David, it just seems like I am having trouble communicating clearly. We are apparently in a disagreement, but your points are not at all what I wanted to explain... I'll try again. i totally understand what you are saying and like i said before, your point

Re: using strict

2004-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: Yet another great explanation.. What explanation? I see niothing above this. Please do not top-post when posting to this list. Instead, follow the material to which you are directly responding with your response, then trim any extraneous material. Most of us keep

Re: using strict

2004-04-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote: Hello Derek, Guay, Err, my first name is Jean-Sebastien. Hi Jean-Sebastien, My last name is Guay. French-language people have a bad habit to put the last name first, as in Guay, Jean-Sebastien... So I understand why this is a bit confusing. Thanks for the

Re: using strict

2004-04-04 Thread R. Joseph Newton
david wrote: Guay Jean-Sébastien wrote: open (CRITICALSERVERS, $crout) || die can't open file \n: $!; As I said, you should replace || by or in the above line. See the precedence rules in perldoc perlop for details. why do you think so? is there any problem in the above line? Good

Re: using strict

2004-04-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote: There is no problem syntactically. But there is a problem with the precdence. If you ever have another operation on either the left or right side of the || operator, the || operator will bind tighter than the other operation. So for example, if you do: my $errors

Re: using strict

2004-04-04 Thread Paul Johnson
On Sun, Apr 04, 2004 at 01:28:42PM -0700, R. Joseph Newton wrote: Guay Jean-Sébastien wrote: my $errors = 0; open (CRITICALSERVERS, $crout) || $errors += 2; that will translate to: my $errors = 0; ( open (CRITICALSERVERS, $crout) || $errors ) += 2; Nope. $ perl -MO=Deparse,-p

Re: using strict

2004-04-04 Thread R. Joseph Newton
Paul Johnson wrote: On Sun, Apr 04, 2004 at 01:28:42PM -0700, R. Joseph Newton wrote: Guay Jean-Sébastien wrote: my $errors = 0; open (CRITICALSERVERS, $crout) || $errors += 2; that will translate to: my $errors = 0; ( open (CRITICALSERVERS, $crout) || $errors ) += 2;

RE: using strict

2004-04-02 Thread DBSMITH
strict Hello Derek, When using strict, the error message should point you to the line where the error is. It's usually pretty darn good at pointing the right line. In this case, I bet it's this one: while ( defined($line = CRITICALSERVERS) ) { There is no declaration of the $line

Re: using strict

2004-04-02 Thread DBSMITH
. Smith OhioHealth IT UNIX / TSM / EDM Teams [EMAIL PROTECTED] 04/01/2004 06:02 PM To: [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject:Re: using strict In a message dated 4/1/2004 5:03:40 PM Eastern Standard Time, [EMAIL PROTECTED] writes: People

Re: using strict

2004-04-02 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: Yet another great explanation... thank you! But I still need to know how to print each specific element # along with its data? Is this the right way to go for storing each line in its own element??? while $line FILEHANDLE my @tsm = FILEHANDLE foreach $_ (@tsm)

RE: using strict

2004-04-02 Thread Guay Jean-Sébastien
and getting one line at a time until we get to the end of the file. Hope this helps, Jean-Sébastien -Message d'origine- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Date: 2 avril, 2004 10:12 À: Guay Jean -Sébastien Cc: Perl Beginners Objet: RE: using strict Guay, ooops. that would

RE: using strict

2004-04-02 Thread david
Guay Jean-Sbastien wrote: open (CRITICALSERVERS, $crout) || die can't open file \n: $!; As I said, you should replace || by or in the above line. See the precedence rules in perldoc perlop for details. why do you think so? is there any problem in the above line? david --

RE: using strict

2004-04-02 Thread Guay Jean-Sbastien
Guay Jean-Sbastien wrote: open (CRITICALSERVERS, $crout) || die can't open file \n: $!; As I said, you should replace || by or in the above line. See the precedence rules in perldoc perlop for details. why do you think so? is there any problem in the above line? There is no problem

RE: using strict

2004-04-02 Thread DBSMITH
construct instead of the array assuming memory is not an issue? Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Guay Jean-Sébastien [EMAIL PROTECTED] 04/02/2004 02:20 PM To: Perl Beginners [EMAIL PROTECTED] cc: Subject:RE: using strict Hello Derek

RE: using strict

2004-04-02 Thread Guay Jean-Sébastien
Hello Derek, can I email you from know on??? : ) You are so through! Thank you! No, I would prefer that you always reply to the list. First reason is that other beginners can benefit from our exchange (and the mails end up in a searchable archive), second is that if I'm not there (or for

RE: using strict

2004-04-02 Thread david
Guay Jean-Sbastien wrote: Guay Jean-Sbastien wrote: open (CRITICALSERVERS, $crout) || die can't open file \n: $!; As I said, you should replace || by or in the above line. See the precedence rules in perldoc perlop for details. why do you think so? is there any problem in the above

using strict

2004-04-01 Thread DBSMITH
People of the Perl, from my understanding strict disallows soft references, ensures that all variables are declared before usage and disallows barewords except for subroutines. what is a soft reference? what is a bareword? why is strict disallowing a compile here When I comment out strict

RE: using strict

2004-04-01 Thread Guay Jean-Sébastien
Hello Derek, When using strict, the error message should point you to the line where the error is. It's usually pretty darn good at pointing the right line. In this case, I bet it's this one: while ( defined($line = CRITICALSERVERS) ) { There is no declaration of the $line variable. Try

Re: using strict

2004-04-01 Thread Daniel Staal
--As of Thursday, April 1, 2004 5:01 PM -0500, [EMAIL PROTECTED] is alleged to have said: what is a soft reference? what is a bareword? why is strict disallowing a compile here When I comment out strict the syntax checks outs as ok!??? how do I display each element # with its corresponding

Re: using strict

2004-04-01 Thread Randy W. Sims
On 4/1/2004 5:01 PM, [EMAIL PROTECTED] wrote: People of the Perl, from my understanding strict disallows soft references, ensures that all variables are declared before usage and disallows barewords except for subroutines. what is a soft reference? what is a bareword? why is strict

Re: using strict

2004-04-01 Thread u235sentinel
Does the following turn off strict for a vars? no strict vars; Could you also turn off strict for other things besides vars, refs and subs? Say for a subroutine (for example). Just curious. I've run into situations where I've come across badly maintained code and would like to do this for

Re: using strict

2004-04-01 Thread WilliamGunther
In a message dated 4/1/2004 5:03:40 PM Eastern Standard Time, [EMAIL PROTECTED] writes: People of the Perl, from my understanding strict disallows soft references, ensures that all variables are declared before usage and disallows barewords except for subroutines. what is a soft reference?

Re: using strict

2004-04-01 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Does the following turn off strict for a vars? no strict vars; Could you also turn off strict for other things besides vars, refs and subs? Say for a subroutine (for example). Pragma are block/file scoped similar to a lexical. To answer your question below, yes you

Re: Using strict and a configuration file?

2002-06-11 Thread Ramprasad A Padmanabhan
just define all vars in ur conf file with a scope reslution eg $global::test = 'hello'; Octavian Rasnita wrote: Hi all, Is it possible to use use strict; if I get the variables from a configuration file? I've tried: use strict; require f:/xxx/config.txt; #In the configuration

RE: Using strict and configuration files

2002-06-11 Thread Camilo Gonzalez
Bob, Exactly what does our do? I understand my and even local but have yet to grasp the our concept. -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:12 AM To: 'Octavian Rasnita'; [EMAIL PROTECTED] Subject: RE: Using strict

RE: Using strict and configuration files

2002-06-11 Thread Bob Showalter
-Original Message- From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:16 AM To: 'Bob Showalter'; 'Octavian Rasnita'; [EMAIL PROTECTED] Subject: RE: Using strict and configuration files Bob, Exactly what does our do? I understand my and even

RE: Using strict and configuration files

2002-06-11 Thread Camilo Gonzalez
So the following are equivalent: use vars qw(foo) our $foo = -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:17 AM To: 'Camilo Gonzalez'; [EMAIL PROTECTED] Subject: RE: Using strict and configuration files -Original Message

RE: Using strict and configuration files

2002-06-11 Thread Bob Showalter
-Original Message- From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:21 AM To: 'Bob Showalter'; Camilo Gonzalez; [EMAIL PROTECTED] Subject: RE: Using strict and configuration files So the following are equivalent: use vars qw(foo) our $foo

Re: Using strict and a configuration file?

2002-06-11 Thread David T-G
Teddy -- ...and then Octavian Rasnita said... % % Hi all, Hello! % % Is it possible to use use strict; if I get the variables from a % configuration file? % % I've tried: % % use strict; % require f:/xxx/config.txt; Have you tried use f:/xxx/config.txt; instead? From my reading of

RE: Using strict and a configuration file?

2002-06-10 Thread Maureen E Fischer
: Using strict and a configuration file? Hi all, Is it possible to use use strict; if I get the variables from a configuration file? I've tried: use strict; require f:/xxx/config.txt; #In the configuration file I have a line like my $test = test test test; print Content-type: text/html\n\n

Using strict and a configuration file?

2002-06-07 Thread Octavian Rasnita
Hi all, Is it possible to use use strict; if I get the variables from a configuration file? I've tried: use strict; require f:/xxx/config.txt; #In the configuration file I have a line like my $test = test test test; print Content-type: text/html\n\n; print $test; This gives me an error that

Re: Using strict and configuration files

2002-05-29 Thread Carl Franks
Hi, This is how I do it. #!/usr/bin/perl -wT use strict; my $conf; unless ($conf = do ('/path/to/config.pl')) { die (Could not open file); } print $conf-{'var1'}, \n; - Then in a file called config.pl { var1 = one, var2 = two } - The unless part is just to check that the

Using strict and configuration files

2002-05-28 Thread Octavian Rasnita
Hi all, I want to use: use strict; And I want to use a configuration file in a Perl script. The configuration file uses: %page1=( ); %page2=( ); This way I get errors if I run the script because the variables are not defined with my. I've tried putting in the configuration file:

Re: Using strict with DBI

2002-05-15 Thread Rob Roudebush
$sth = $dbh-prepare(select ID from maintenance); this should read: my($sth) = $dbh-prepare(select ID from maintenance); That didn't seem to work for me for some reason. Another question - how do I apply strict to the lines below. And how do I just avoid the private or my declaration by

RE: using strict and -w

2002-05-01 Thread Bob Showalter
-Original Message- From: Robert Beau Link [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 8:27 PM To: [EMAIL PROTECTED] Subject: using strict and -w ... And where might I have found that answer within perldoc? I tried perldoc -q strict and got No documentation

Re: Using strict with DBI

2002-04-30 Thread Mark Bergeron
Rob, use strict; shouldn't really affect the syntax of any DBI handle or statement. I would help if you included an example for us to have look at here. -Original Message- From: Rob Roudebush[EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon Apr 29 18:15:23 PDT 2002 Subject: Using strict

Re: Using strict with DBI

2002-04-30 Thread Todd Wade
Rob Roudebush [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've seemed to have narrowed down the problem to $sth variable, I guess I can't declare this as a private variable because it prepares it and needs to have it at least local or global to access it?

using strict and -w

2002-04-30 Thread Beau
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Howdy, Thanks to Matt for pointing me in the right direction re: mod_perl. Here's my latest: working through the perl tutorial docs at http://www.devshed.com/Server_Side/Perl/Perl101/Perl101_2/page3.html I've created the code that follows;

Re: using strict and -w

2002-04-30 Thread drieux
On Tuesday, April 30, 2002, at 05:27 , Robert Beau Link wrote: [..] #!/usr/bin/perl -w use strict; print Number, please...; $alpha = STDIN; print Another, please...; $beta = STDIN; $sum= $alpha + $beta; $diff = $alpha - $beta; $product = $alpha * $beta; $quotient = $alpha / $beta;

Using strict and getting return values

2002-03-04 Thread Dermot Paikkos
Hi Gurus, I am trying to get tidy with my scripts and want to use Strict but am having difficulty with return values from subroutines. I have the following snippet: while (defined(my $i =$fh)) { chomp($i); my @a = split(/|/,$i); my $last = $a[1]; my $first = $a[0]; if (

RE: Using strict and getting return values

2002-03-04 Thread Jason Larson
-Original Message- From: Dermot Paikkos [mailto:[EMAIL PROTECTED]] Subject: Using strict and getting return values Hi Gurus, Well, I'm definitely not a guru, but I think I might be able to help... :) I am trying to get tidy with my scripts and want to use Strict but am having

Filehandle error using Strict

2001-09-05 Thread Deborah Strickland
Hi all, I've had this question for quite a while and can't find any reference to it in any of my many Perl books. I want to use the 'strict' command but whenever I do it always causes an error on any file handles I have used. I always declare everything but have never seen a filehandle declared

using Strict with filehandles

2001-09-05 Thread Deborah Strickland
Hi, I can't find the answer to this in any of my many Perl books so I'm asking you. I want to do 'use strict' but when I also use it with a file handle I get an error. How can I declare a file handle variable such that 'use strict' won't generate an error? This fails. use strict; open (FN,

Re: using Strict with filehandles

2001-09-05 Thread Andrea Holstein
Deborah Strickland wrote: Hi, I can't find the answer to this in any of my many Perl books so I'm asking you. I want to do 'use strict' but when I also use it with a file handle I get an error. How can I declare a file handle variable such that 'use strict' won't generate an error? This

Re: Filehandle error using Strict

2001-09-05 Thread Ron Smith
; ---snip--- Ron From: Deborah Strickland [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Filehandle error using Strict Date: Tue, 04 Sep 2001 10:17:04 -0700 Hi all, I've had this question for quite a while and can't find any reference to it in any of my

Re: Filehandle error using Strict

2001-09-05 Thread John W. Krahn
Deborah Strickland wrote: Hi all, I've had this question for quite a while and can't find any reference to it in any of my many Perl books. I want to use the 'strict' command but whenever I do it always causes an error on any file handles I have used. What errors are you getting? I

using strict

2001-06-27 Thread Hans Holtan
Hi everyone, I get this error when I run my script, and I don't understand why: Can't use string (CHR3) as a symbol ref while strict refs in use at AtIntergenicTableSort.pl line 53. I'm trying to split my output into 5 seperate files based on what is in the key. Here is a snip of code:

RE: using strict

2001-06-27 Thread Stephen Nelson
files to be CHR1, CHR2, etc... -Original Message- From: Hans Holtan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 4:36 PM To: [EMAIL PROTECTED] Subject: using strict Hi everyone, I get this error when I run my script, and I don't understand why: Can't use string (CHR3

using strict - ADDENDUM

2001-06-27 Thread Hans Holtan
Hi everyone, I forgot to mention that I did open the output files earlier in the program, ie CHR1, CHR3 ... CHR5. Here is the whole thing: #!usr/bin/perl -w use strict; my ($input,$output,$k,$v,$gene, $input_string, $output1,$output2,$output3,$output4,$output5, $file, $junk,$i,

RE: using strict

2001-06-27 Thread Paul
}\n; -Original Message- From: Hans Holtan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 4:36 PM To: [EMAIL PROTECTED] Subject: using strict Hi everyone, I get this error when I run my script, and I don't understand why: Can't use string (CHR3

Re: using strict

2001-06-27 Thread Michael Fowler
On Wed, Jun 27, 2001 at 04:54:17PM -0700, Paul wrote: Another trick -- use FileHandle and put them into an array. my @FILE; for (1..5) { $FILE[$_] = new FileHandle CHR$_ or die CHR$_: $!; } now you can say: print $FILE[$_] $k\t$all_genes{$k}\n; This doesn't actually

Re: using strict - ADDENDUM

2001-06-27 Thread Brett W. McCoy
On Wed, 27 Jun 2001, Hans Holtan wrote: I forgot to mention that I did open the output files earlier in the program, ie CHR1, CHR3 ... CHR5. But you can't say $file = CHR1, beacuse then you are creating a symbolic reference to a filehandle. Very bad. Do this instead: $file = *CHR1; Then

Re: using strict - ADDENDUM

2001-06-27 Thread Brett W. McCoy
On Wed, 27 Jun 2001, Brett W. McCoy wrote: But you can't say $file = CHR1, beacuse then you are creating a symbolic reference to a filehandle. Very bad. Do this instead: $file = *CHR1; Then you can properly use your filehandle. What you really want to do is create an array of open