conda-forge / perl-feedstock

A conda-smithy repository for perl.
BSD 3-Clause "New" or "Revised" License
3 stars 32 forks source link

perl 5-26 seems to break certain programs, like cloc #26

Closed wesm closed 3 years ago

wesm commented 6 years ago

I noticed that cloc.pl (for counting source lines of code) stopped working with the 5.26 upgrade. Any ideas what's wrong?

$ cloc
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/bin/cloc line 1166.

works fine w/ 5.24

xileF1337 commented 6 years ago

Perl's syntax changed and the script you mentioned uses the now-invalid construct defined(@array). It needs to be updated. From the Perl documentation perldoc -f defined of v.5.22.2:

            Use of "defined" on aggregates (hashes and arrays) is deprecated.
            It used to report whether memory for that aggregate had ever been
            allocated. This behavior may disappear in future versions of Perl.
            You should instead use a simple test for size:

                if (@an_array) { print "has array elements\n" }
                if (%a_hash)   { print "has hash members\n"   }

With Perl 5.26, this feature has been removed completely. This is not a bug.