Further to tybalt89's reply: The s/// substitution operator can take arbitrary delmiters (within reason), so expressions like s.misc04 in your code are confusing Perl. Don't do that.
Please see discussion of s/PATTERN/REPLACEMENT/ in Regexp Quote-Like Operators in perlop.c:\@Work\Perl\monks>perl -wMstrict -le "my $x = 'abXcd'; print qq{'$x'}; ;; $x =~ s.X.Y.; print qq{'$x'}; " 'abXcd' 'abYcd'
Update: If you do not have strictures enabled (see use strict;), expressions like o.misc04 or r.service will be meaningless to Perl (unless you happen to have functions named o() or service(), etc., defined). With strictures enabled, the expression won't compile. Enabling warnings (use warnings;) can be very helpful as well.
c:\@Work\Perl\monks>perl -le "my $hr = { 'o.misc04' => 'xxx' }; print qq/'$$hr{o.misc04}'/; " '' c:\@Work\Perl\monks>perl -le "use warnings; ;; my $hr = { 'o.misc04' => 'xxx' }; print qq/'$$hr{o.misc04}'/; " Unquoted string "o" may clash with future reserved word at -e line 1. Use of uninitialized value in concatenation (.) or string at -e line 1 +. '' c:\@Work\Perl\monks>perl -le "use warnings; use strict; ;; my $hr = { 'o.misc04' => 'xxx' }; print qq/'$$hr{o.misc04}'/; " Bareword "o" not allowed while "strict subs" in use at -e line 1. Bareword "misc04" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors.
Further Update: And I should have included one further code variation:
c:\@Work\Perl\monks>perl -le "use warnings; use strict; ;; my $hr = { 'o.misc04' => 'xxx' }; print qq/'$$hr{ 'o.misc04' }'/; " 'xxx'
Give a man a fish: <%-{-{-{-<
In reply to Re: Substitution pattern not terminated
by AnomalousMonk
in thread Substitution pattern not terminated
by kp2a
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |