Hi
Its has nothing to do with bless though, strict is protecting you from ambiguous code
$ splain < 2
perl -c packtest.pl
Bareword "PENDULUM" not allowed while "strict subs" in use at packates
+t.pl line
9 (#1)
(F) With "strict subs" in use, a bareword is only allowed as a
subroutine identifier, in curly brackets or to the left of the "=>
+"
symbol. Perhaps you need to predeclare a subroutine?
packtest.pl had compilation errors (#2)
(F) The final summary message when a perl -c fails.
ambiguous code (bareword PENDULUM)
$ perl -le" print bless {}, PENDULUM; "
PENDULUM=HASH(0x3f9adc)
$ perl -le" sub PENDULUM { 666 } print bless {}, PENDULUM; "
666=HASH(0x3f9adc)
See Ill-Advised Uses of Barewords in modern_perl_2016_a4.pdf page 167
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.