Open JesseHawkins-zz opened 8 years ago
Thanks for pointing this out. I escaped the { and } on lines 760, 764, 765 thanks to this direction. Only lines I needed to change to fix the errors I was getting, but wouldn't have figured it out without this post. Thanks a lot!
Thanks for the info, I was also about to fix it like this and found the confirmation here.
Here is a patch for fast command-line patching:
--- plexWatch.pl 2017-08-07 01:51:45.641446183 +0200
+++ plexWatch.pl 2017-08-07 01:52:33.442447850 +0200
@@ -757,12 +757,12 @@
$format =~ s/\[\]//g; ## trim any empty variable encapsulated in []
$format =~ s/\s+/ /g; ## remove double spaces
$format =~ s/\\n/\n/g; ## allow \n to be an actual new line
- $format =~ s/{{newline}}/\n/g; ## allow \n to be an actual new line
+ $format =~ s/\{\{newline\}\}/\n/g; ## allow \n to be an actual new line
## special for now.. might make this more useful -- just thrown together since email can include a ton of info
- if ($format =~ /{{all_details}}/i) {
- $format =~ s/\s*{{all_details}}\s*//i;
+ if ($format =~ /\{\{all_details\}\}/i) {
+ $format =~ s/\s*\{\{all_details\}\}\s*//i;
$format .= sprintf("\n\n%10s %s\n","","-----All Details-----");
my $f_extra;
foreach my $key (keys %{$info} ) {
Apply patch with:
patch plexWatch.pl patch_file
I'm probably posting this in the wrong area, so please excuse my GitHub-noobyness.
When running plexWatch.pl, I was greeted with a few occurrences of, "Unescaped left brace in regex is deprecated..." along with line numbers. A quick Google indicates that curly braces need to be escaped to fix this error message, and that eventually this error message will become a syntax error. Seemed like a good enough justification to find a fix.
My modified script runs without issues, as far as I can tell, after I made these changes:
Changed to:
Hope that this is helpful to someone. :)