fix perl compilation errors introduced by recent refactor