A cheapo- way out would be to mount a piece of pegboard to a straight board. This gives you a guide (the board) to put up against the vertical sides of the shelf and a guide for each hole (the pegboard).

You need to be careful of the depth of the holes, of course.


::::::: No disrespect to Axiom, but my favorite woofer is my yellow lab :::::::