in reply to Substitution pattern not terminated

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