cperl icon indicating copy to clipboard operation
cperl copied to clipboard

Cannot install ExifTool because of strict hashpairs

Open jiucenglou opened this issue 5 years ago • 2 comments

Attempt to install ExifTool to CPerl failed due to strict hashpairs. Because the existing post of fixes does not list ExifTool, could you suggest how to fix ? Many thanks !

$ sudo cpan5.30.0 App::cpanminus
$ head -n 1 `which cpanm`
#!/usr/local/bin/cperl5.30.0
$ sudo cpanm  Image::ExifTool

The error is

Only pair in map hash assignment allowed while "strict hashpairs", got 4 elements at /home/test/.cpanm/work/1598527653.7099/Image-ExifTool-12.00/blib/lib/Image/ExifTool/Validate.pm line 154.
Compilation failed in require at /home/test/.cpanm/work/1598527653.7099/Image-ExifTool-12.00/blib/lib/Image/ExifTool.pm line 2165.
t/ExifTool.t .......
Dubious, test returned 255 (wstat 65280, 0xff00)

The corresponding line in Validate.pm

153 # generate lookup for any IFD
154 my %stdFormatAnyIFD = map { %{$stdFormat{$_}} } keys %stdFormat;
155

jiucenglou avatar Aug 27 '20 11:08 jiucenglou

This module does not confirm to the strict rules of cperl or perl6. Add a no strict to it's scope before line 2165.

Just from looking at it, it looks extremely fishy, not to say wrong.

rurban avatar Aug 27 '20 13:08 rurban

ExifTools can be installed to CPerl after no strict "hashpairs" is added immediately after use strict in Validate.pm. Furthermore, perlcc runs fine towards a hello-world script that uses ExifTools installed.

Many thanks for your great work and kind help !

jiucenglou avatar Aug 27 '20 14:08 jiucenglou