in reply to Substitution pattern not terminated
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
|
|---|