Re: [Setup-tool-hackers] use strict;



On 15 Aug 2001 13:44:10 -0400, Arturo Espinosa Aldama wrote:
> 
> 
> Hi. The problem with Perl complaining about close (undef) was because
> boot.pl.in had use strict inside it, but the code itself didn't honour it.

Sorry, I didn't mean to leave it in, just forgot to remove before
commiting.

> I think that before using strict we should reshape the code so that it
> works in a robust way, and that requires understanding what use strict
> means.

use strict;        # apply all possible restrictions

use strict 'vars'; # restrict unsafe use of variables for rest of block
use strict 'refs'; # restrict unsafe use of references for rest of block
use strict 'subs'; # restrict unsafe use of barewords for rest of block

That's all there is to understand.

> In my case, I just know a couple of situations where strict changes Perl's
> behaviour: mostly annoying stuff, like not allowing you to use undef in
> string operations (although undef eq ""), and a couple more like that. So

That's interesting cause:

use strict;
my $a;

$a = $a . "Hello world";
print "$a\n";

doesn't give me any warnings/errors, just prints out 'Hello world'.

Tambet


_______________________________________________
setup-tool-hackers maillist  -  setup-tool-hackers@ximian.com
http://lists.ximian.com/mailman/listinfo/setup-tool-hackers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]