Running cloc 1.64 on Perl 5.22 throws errors such as:
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/bin/cloc line 1284.
After several of those are fixed, the following warnings get emitted:
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/cloc line 4626.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\end{ <-- HERE code}/ at /usr/bin/cloc line 4655.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/cloc line 4657.
The person who reported this to Arch Linux has also supplied a patch; you can find it attached to https://bugs.archlinux.org/task/45494
Anonymous
I understand the problem with the deprecated 'defined(@array)' stuff; the issue is that if I use the newer form, then I break support for legacy versions of Perl.
The other warnings are easily fixed by backslashing the {}.
I'll try to figure out a solution that satisfies old and new versions of Perl.
Do you know which Perl versions would break by removing "defined"? I was only able to find information about hashes, but nothing about arrays. [1]
[1] http://perldoc.perl.org/perl583delta.html#Core-Enhancements
I seem to recall 5.6.x didn't like the absence of defined. I could be mistaken though. Tomorrow I'll have access to some machines with old Perls and will test there. I just tried to build Perl 5.6.2 from source (on ubuntu 14.04 + gcc 4.8.4) but that build fails with C syntax errors.
I was mistaken; 5.6.1 (on an old Solaris box) had no issues without the defined(). I therefore removed those instances from the code & also fixed the braces issue; svn commit 461.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
same error here.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.*?){ <-- HERE [^$]/ at /bin/cloc line 4850.
Note: cloc is no longer developed on sourceforge. Development now happens at https://github.com/AlDanial/cloc
Try using the lastest release, 1.76, available at https://github.com/AlDanial/cloc/releases, and see if that resolves your issue.