#!/usr/bin/perl # did_we_get_all --- from the BLM server? Version 2. # Author: Dan Jacobson https://www.jidanni.org/ # Copyright: https://www.gnu.org/licenses/gpl.html # Created: 2024-05-14T23:13:50+0000 # Last-Updated: 2024-05-14T23:20:49+0000 # Update #: 11 use strict; use warnings q!all!; =head1 Usage $ did_we_get_all file.json Checks the json returned via fetch_blm_sections from the BLM , trusting that it lists what we requested accurately, comparing that with what was actually retrieved, which is also contained in that same file. =cut use strict; use warnings q(all); use JSON::PP; # Installed already... my $I; while (<>) { $I .= $_ } my $p = decode_json $I; my %wanted; undef $wanted{$_} for @{ $p->{generatedplss} }; delete $wanted{ $_->{plssid} } for @{ $p->{coordinates} }; my @missed = sort keys %wanted; exit unless @missed; print scalar @missed, " not gotten:\n"; print "$_$/" for @missed; exit 33;