perl -MTime::Piece -le"$t=localtime->strptime(shift,'%Y%m%d');print 'last day' if $t->mday == $t->month_last_day" 20010731