#!/usr/bin/perl # Extract IMMA records for a particular season (July in selected # year to June in the year following). use strict; use warnings; use IMMA; use FindBin; use Time::Local; use Getopt::Long; my $Year; GetOptions( "year=i" => \$Year ); unless ( defined($Year) ) { die "No year specified"; } lo_ob: while ( my $ob = imma_read( \*STDIN ) ) { foreach (qw(YR MO LAT LON)) { unless ( defined( $ob->{$_} ) ) { next lo_ob; } } unless ( ( $ob->{MO} > 6 && $ob->{YR} == $Year ) || ( $ob->{MO} < 7 && $ob->{YR} == $Year + 1 ) ) { next; } $ob->write( \*STDOUT ); }