I was not able to replicate this issue with warnings and strict enabled. With both of those enabled, other errors appear before even getting to this "Substitution" problem with "s.". E.g. "bareword "o.misc04" is not allowed". Note that $$i{s.misc04} is not a valid hash key under "warnings" and "strict".

Essentially you have a problem in the code that even allowed you got get to an obscure error message. Fix the thing that caused that initial problem (use both strict; and warnings;).

Also, I personally highly recommend the arrow notation when de-referencing say a hash ref in this case.

#!/usr/bin/perl use strict; use warnings; my %h = ("o.misc04" => 1, "o.misc05" => 10); my $i = \%h; my $onip = ($$i{"o.misc04"} << 4) + $$i{"o.misc05"}; print "\$onip is: $onip\n"; $onip = ($i->{"o.misc04"} << 4) + $i->{"o.misc05"}; print "\$onip is: $onip\n"; __END__ prints: $onip is: 26 # 1<<4 +10 = 16 + 10 = 26 $onip is: 26 # 1<<4 +10 = 16 + 10 = 26

In reply to Re: Substitution pattern not terminated by Marshall
in thread Substitution pattern not terminated by kp2a

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.