Page 1 of 1

Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32)

Posted: Mon Jun 25, 2018 7:34 pm
by toodr
Since today, after an update of perl from 5.26 to 5.28 and a recompilation of ZoneMinder (from git) I am getting those messages when starting the zm:

root@jastreb:/usr/share/perl5/vendor_perl/ZoneMinder# /etc/rc.d/rc.zm start
Starting ZoneMinder: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
25.06.2018 22:22:52.317031 zmpkg[1147].INF [Sanity checking States table...]
25.06.2018 22:22:52.319009 zmpkg[1147].INF [Command: start]
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
25.06.2018 22:22:54.928006 zmpkg[1147].INF [Single server configuration detected. Starting up services.]
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^({ <-- HERE .+})$/ at /usr/share/perl5/vendor_perl/ZoneMinder/General.pm line 657.
[ OK ]

Anyway, zm is starting fine, and working as usual. I wonder if I should upgrade to perl 5.32 when the time comes ?

Re: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32)

Posted: Fri Jun 29, 2018 7:37 pm
by asker
Based on this change, it seems. If you did update to perl 5.32, per this message, its very likely ZM would error out in this part due to perl erroring out.


I think patching General.pm line 657 to escape that brace will work

https://github.com/ZoneMinder/zoneminde ... al.pm#L657

Old:

Code: Select all

( $out ) = $out =~ m/^({.+})$/; # Detaint and check it's a valid object syntax
New:

Code: Select all

( $out ) = $out =~ m/^(\{.+})$/; # Detaint and check it's a valid object syntax
Not sure if it occurs elsewhere, but you'll know if any other line complains. Should be put into ZM too.

Re: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32)

Posted: Sun Jul 01, 2018 10:20 pm
by iconnor
I think they should probably both be escsaped... I am committing the fix to ZM master.

Re: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32)

Posted: Thu Jul 12, 2018 4:44 pm
by toodr
I recompiled and applied the patch. Now it is working fine. No more warning messages.
Thanks alot.