moved from mshinall/scripts/perl