[EMAIL PROTECTED] wrote:

> All,
>
> I added the "use strict;" statement to my script for the first time and
> received the following compilation errors:
> Global symbol "$LoginName" requires explicit package name at todaysFiles.pl
> line 43.

This error means that "$LoginName was declared without a statement indicating what 
package it is meant to be part of.  It is not a hard question to answer.  Simply make 
sure that before you use a variable in your code, you tell the interpreter that it is 
being introduced:
my $login_name;
or
my $login_name = "pittmans";

It can get a little more complicated.  If you care about your data, you will probably 
want to declare your variables only within subs or other blocks, so that it is more 
difficult to accidentally corrupt their values.

> This program works fine without the "use strict" statement?.please advise!!

use strict;
and deal with the errors the interpreter issues.  If it gives you an error message, 
that is because you are doing something that will make errors more likely.  Choosing 
not to use strict is a directive to the compiler "give me enough rope to ang myself"  
The compiler will respect that directive.

> Also, can someone offer an explanation of how "=" differs from "= ="??

= assignment
== numeric comparison

If you use the assignment operator in a context calling for numeric comparision, the 
operation will return true unless you are assigning 0, the empty string '', or undef 
to the variable.  If you have warnings enabled, the interpreter will catch most such 
cases and warn you about them.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to