Buckaroo Buddha recently asked a question about
strict
in the node
looking for Advice on how strict i should really be.
In his code he used the keyword
our, which is now
deprecated. I looked through some reference manuals (not
extensively, please forgive) and could not find any info
on this keyword.
I tried a little code to see
what Perl v5.005_03 had to say:
use strict;
our $stuff = 5;
print "$stuff\n";
and received the following:
Use of reserved word "our" is deprecated ...
Global symbol "$stuff" requires explicit package name ...
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'.
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 :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.