develooper Front page | perl.beginners | Postings from February 2002

Re: use strict

Thread Previous | Thread Next
From:
Dave Benware
Date:
February 5, 2002 11:59
Subject:
Re: use strict
Message ID:
3C60398B.F947F40@Townisp.com
Octavian Rasnita wrote:
> 
> Hello all,
> I am a new member. please tell me what is used for the following line in a
> script:
> 
> use strict;
> 
> I saw that if I use it, this make sometimes my scripts to have errors and
> without it, they works.
> Thanks!
> Teddy,
> My dear email address is orasnita@yahoo.com


As Jason and Frank pointed out, use strict means your Perl code is
no longer a "loosely written language", :~(  and therefore, some common,
(dumb/silly/stupid mistakes), can be avoided.

However, in order to use strict, one must learn scoping which is not
a one-hour-done-and-over-with type of thing, heh.  I know cuz I am
presently trying to learn it after a year of ignoring it.

If you're writing small scripts or just installing other peoples'
scripts and that's as far as you expect to go with Perl, you could
do without it, *IMHO*.

Otherwise, it would be best to dig into it as soon as possible,
develop the habit, make it a natural thing.

Here's a few places where I've begun:

http://www.perldoc.com/perl5.6.1/pod/perlsub.html#Private-Variables-via-my()
http://www.perldoc.com/perl5.6.1/pod/func/my.html
http://www.perldoc.com/perl5.6.1/pod/func/our.html
http://www.perldoc.com/perl5.6.1/lib/strict.html
http://www.perldoc.com/perl5.6.1/pod/func/local.html

Bompa

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About