如何通过Perl模块获取图像的元数据?

如何通过Perl模块获取图像的元数据?,perl,image,metadata,Perl,Image,Metadata,我通过MacPorts安装了以下组件: p5-image-info @1.16 (perl, graphics) Extract meta information from image files 它说你可以用它 Usage is something like this: use Image::Info qw(image_info); @info = image_info("filename"); $refto_hash_describing_1st_image =

我通过MacPorts安装了以下组件:

p5-image-info @1.16 (perl, graphics)
Extract meta information from image files
它说你可以用它

   Usage is something like this:

   use Image::Info qw(image_info);

   @info = image_info("filename");
   $refto_hash_describing_1st_image = $info[0];
   $refto_hash_describing_2nd_image = $info[1];
但是,我跑得不成功

$perl  use Image::Info qw(image_info);
-bash: syntax error near unexpected token `('
$

如何通过Perl模块获取图像的元数据?

所描述的语法是如何在Perl脚本中使用它,而不是如何将其作为shell中的一行使用

将其放入.pl文件(例如“image_info.pl”):

这样运行它:

$ ./image_info.pl file.jpg

它将告诉你大量的信息。

所描述的语法是如何在Perl脚本中使用它,而不是如何将它作为shell中的一行使用

将其放入.pl文件(例如“image_info.pl”):

这样运行它:

$ ./image_info.pl file.jpg
并且沉迷于它将告诉你的大量信息…

阅读 阅读

我收到以下错误消息。我有744个脚本权限。该错误意味着它无法在Perl5搜索路径中找到Image::Info模块。问题显然出在MacPorts中。我假设MacPorts可以将模块放入PERL5LIB,这是我唯一的Perl路径。它显然没有做到这一点。您需要将模块放入PERL5LIB吗?Masi,将/usr/bin/perl更改为/opt/local/bin/perl,以使用您与MacPorts.ok一起安装的perl安装。因此,将/opt/local/lib/perl5/vendor_perl/5.8.9放入PERL5LIBI会得到以下错误消息。我有744个脚本权限。该错误意味着它无法在Perl5搜索路径中找到Image::Info模块。问题显然出在MacPorts中。我假设MacPorts可以将模块放入PERL5LIB,这是我唯一的Perl路径。它显然没有做到这一点。是否需要将模块放入PERL5LIB中?Masi,将/usr/bin/perl更改为/opt/local/bin/perl,以使用随MacPorts.ok一起安装的perl安装,因此将/opt/local/lib/perl5/vendor_perl/5.8.9放入PERL5LIB中