I don't know what your objection is, but I would use a laser (or several). As far as activating it, there's already technology such as Microsoft's Kinect that can measure how far away someone is from a distance, so it could activate well before someone steps in between the posts.
This may not be quite what you were describing, but I'm thinking of something that's a deterrent as well as a defense (this is how I think it "should" work - a device that just has a sign that says "Warning, this will kill you" may collect the bodies of young children and those who can't read English). When you get within ten feet it shines a red laser on you, the low-power handheld kind - it won't hurt you unless you have the bad luck of it shining directly into your eye, but it demonstrates the point that you've been detected. As you get closer the real stuff turns on, such as the millimeter-wave RF beam already mentioned (it's like a microwave oven, but at a higher frequency, so it just barely pentrates the skin and heats up your pain-detecting nerves) that causes a burning feeling. If you somehow continue and get between the post, things (could be microwave, could be infrared laser, whatever) turn on full throttle and you catch on fire.
This system will easily enough to deter a casual person (or animal) who may accidentally get too close, but trying to run between the posts is instant suicide.