change perl to ruby