it seems to me the problem is only found after using the range operator. also notice the bareword can be any word, it does not need to be in an existing glob.

> perl -w -Mstrict -e"my%f;++@f{(1,2)};die'ack'if foo eq 'bar'" Bareword "foo" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. > perl -w -Mstrict -e"my%f;++@f{qw/1 2/};die'ack'if foo eq 'bar'" Bareword "foo" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. > perl -w -Mstrict -e"my%f;++@f{1..2};die'ack'if foo eq 'bar'" >
(ActiveState Perl 5.6.1, Win32)

a look at the code using B::Terse might help a little...

> perl -w -MO=Terse -Mstrict -e"my%f;++@f{1..2};die'ack'if foo eq 'bar +'" LISTOP (0x182015c) leave [1] OP (0x3c3f34) enter COP (0x182b404) nextstate OP (0x182b4e8) padhv [1] COP (0x1821f48) nextstate UNOP (0x3cbe14) preinc LISTOP (0x1821f84) hslice OP (0x3c40b0) pushmark UNOP (0x3c408c) rv2av SVOP (0x3c4030) const SPECIAL #0 Nullsv OP (0x1821fac) padhv [1] COP (0x3c3f64) nextstate UNOP (0x1828c28) null LOGOP (0x1828c4c) and BINOP (0x1828c74) seq SVOP (0x3c3fd4) const PV (0x182a7d4) "foo" SVOP (0x3c3fa0) const PV (0x392c20) "bar" LISTOP (0x3c3ff8) die [4] OP (0x1821ec4) pushmark SVOP (0x1821f24) const PV (0x392c08) "ack" -e syntax OK > perl -w -MO=Terse -Mstrict -e"my%f;++@f{(1,2)};die'ack'if foo eq 'ba +r'" Bareword "foo" not allowed while "strict subs" in use at -e line 1. -e had compilation errors. LISTOP (0x182015c) leave [1] OP (0x3c3f1c) enter COP (0x182b404) nextstate OP (0x182b4e8) padhv [1] COP (0x3c404c) nextstate UNOP (0x3c4088) preinc LISTOP (0x3c40ac) hslice OP (0x1821e60) pushmark LISTOP (0x1821ed8) list OP (0x3cbe14) pushmark SVOP (0x1821f24) const SPECIAL #0 Nullsv SVOP (0x1821f00) const SPECIAL #0 Nullsv OP (0x1821f48) padhv [1] COP (0x3c3f3c) nextstate UNOP (0x1828c28) null LOGOP (0x1828c4c) and BINOP (0x1828c74) seq SVOP (0x3c3fac) const SPECIAL #0 Nullsv SVOP (0x3c3f78) const SPECIAL #0 Nullsv LISTOP (0x3c3ff0) die [2] OP (0x3c3fd0) pushmark SVOP (0x3c4018) const SPECIAL #0 Nullsv >

~Particle *accelerates*


In reply to Re: Strange behaviour (bug?) of use strict 'subs' by particle
in thread Strange behaviour (bug?) of use strict 'subs' (was: ... strict 'vars') by Hofmator

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.