I agree the hacksaw will create hundreds of little pills.
My best results were with a box knife. I extended it as far as I could (right before it would release and fall out) and then used an up and down methodical/rythmic saw like motion. Once the blade heated up from friction it actually got a little easier. I also used a metal t-square to help make sure the edge was as square as possible.
Issue with this process...if you don't make the knife go all the way through and if you force it too fast...the foam will ball up as you cut through it and will make it harder to cut.
If when that happens, stop, back up and repeat the saw like motion gently to cut through the pink ball. The edge I got was not perfectly smooth. I was okay with that cause that side was pushed up against the wall and will eventually be setup inside a wooden box frame.
Also, while I used a t-square, I got a straight line. But the wobbly-ness of the blade did not give me a consistent right angle from the table top.
CH