made perl application more testable
refactored test: now it made unit