Skip to content

Instantly share code, notes, and snippets.

@stelf
Created November 22, 2021 12:27
Show Gist options
  • Save stelf/7bab7ecddccce1794ce3f5a96acb833c to your computer and use it in GitHub Desktop.
Save stelf/7bab7ecddccce1794ce3f5a96acb833c to your computer and use it in GitHub Desktop.
#!/usr/local/bin/perl
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
use XML::XPath;
my $ifile = '/Users/user/Downloads/discogs_20211101_releases.xml.gz';
my $ioref = IO::Uncompress::Gunzip->new( $ifile )
or die "gunzip failed: $GunzipError\n";
my $xp = XML::XPath->new(ioref => $ioref );
my $nodeset = $xp->find('/releases/release/track'); # find all paragraphs
foreach ( @$nodeset ) {
say $_
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment