Initial checkin with perl version. Replaces shell version.