#!/usr/bin/perl -nl $maxrank = 1; /^>.*-Z([0-9]+)/ and $rank = $1; print if( $rank <= $maxrank );