use warnings;
use strict;
use Archive::Tar;
use Data::Dumper;
$Data::Dumper::Sortkeys=1;
my @properties = qw(name size mtime);
my $location = "xxx.tar";
my @files = Archive::Tar->list_archive($location, 0, \@properties);
print Dumper(\@files);
Several issues:
- Your @properties array has only 1 element, not 3.
- [\@properties]: The squares brackets in the docs mean that the array ref is optional. You should omit the brackets in your code.
- See Corion's explanation of the 2nd arg: $compressed
- list_archive seems to return a list of hash refs, rather than a hash, which becomes more apparent when you use warnings.