Moved perl statement into perl check