jeffa has asked for the wisdom of the Perl Monks concerning the following question:
I tried a little code to see what Perl v5.005_03 had to say:
and received the following:use strict; our $stuff = 5; print "$stuff\n";
The first line is just a warning, to be expected with the -w option, but the second line is the result of a syntax error, sort of goes against the definition of deprecated I would think. But this has to do with use strict, which doesn't appear to like 'our'.Use of reserved word "our" is deprecated ... Global symbol "$stuff" requires explicit package name ...
Can any one tell a little history about the reserved word 'our' and maybe why it is deprecated? Is it similar to Java's protected modifier?
Much thanks :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: History of 'our'
by autark (Friar) on Jul 22, 2000 at 22:47 UTC | |
|
RE: History of 'our'
by reptile (Monk) on Jul 22, 2000 at 22:51 UTC | |
by merlyn (Sage) on Jul 23, 2000 at 08:03 UTC | |
by japhy (Canon) on Jul 23, 2000 at 07:07 UTC | |
by tye (Sage) on Jul 23, 2000 at 08:04 UTC | |
by japhy (Canon) on Jul 23, 2000 at 19:24 UTC | |
by Anonymous Monk on Jul 24, 2000 at 19:28 UTC | |
by tye (Sage) on Jul 24, 2000 at 19:58 UTC |