changed given to switch so it will run on old perl