Menu

#135 Perl 5.22 support

v1.65
pending
nobody
None
1
2018-02-19
2015-06-28
No

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

Discussion

  • Al Danial

    Al Danial - 2015-06-29
    • status: open --> accepted
    • Group: v1.63 --> v1.65
     
  • Al Danial

    Al Danial - 2015-06-29

    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.

     
  • Evangelos Foutras

    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

     
  • Al Danial

    Al Danial - 2015-06-29

    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.

     
  • Al Danial

    Al Danial - 2015-07-01
    • status: accepted --> pending
     
  • Al Danial

    Al Danial - 2015-07-01

    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.

     
  • Anonymous

    Anonymous - 2018-02-18

    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.

     
  • Al Danial

    Al Danial - 2018-02-19

    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.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.