代码之家  ›  专栏  ›  技术社区  ›  George Godik

如何使用Perl搜索存档文件

  •  3
  • George Godik  · 技术社区  · 16 年前

    使用Perl读取压缩目录内容的首选方法是什么?

    3 回复  |  直到 13 年前
        1
  •  6
  •   Kyle Burton    16 年前

    CPAN上有几个模块用于处理各种存档格式(zip、tar等),您可能需要的是 Archive::Zip .

        2
  •  4
  •   Community c0D3l0g1c    13 年前

    档案::拉链

    require Archive::Zip;
    my $zip = Archive::Zip->new($somefile);
    for($zip->memberNames()) {
      print "$_\n";
    }
    
        3
  •  1
  •   David Nehme    16 年前

    如果需要.tar.gz存档的内容

    open(DIR_LISTING, "gzip -dc concert25.tgz | tar -tf -|") || die;
    while (<DIR_LISTING>) {
       print;
    }
    close (DIR_LISTING);