I agree with the comment on H&K and I own one...incredible gun. But of the 2 you ask about I would go with the Glock. Glock has been on of the top rated combat handguns for many years now. The subcompact I believe is a tad smaller than the Beretta and a bit lighter as well which makes a big difference for concealed carry. Something else, if you are going to carry concealed there's another small advanage to the Glock. If you are carrying it loaded in your jacket pocket you can easily fire it without removing it if you have to because it is hammerless. The Beretta 9000 I believe has an external hammer which in this scenario COULD get caught up in your jacket material and not allow you to fire it without pulling it out. I know, somewhat far fetched scenario but if you are buying and carrying a handgun for personal protection why not cover every angle possible no matter how far fetched it may seem.
Something to consider though: Will you feel comfortable carrying the Glock with a round chambered being that there is no hard safety on it other than the "mini trigger" that aligns the firing pin? If not don't bother with it and get the Beretta. But if you know that won't bother you then I would say go for the Glock without a second thought.