update script to use perl, a lot more consistent across platforms