An alternate method that is widely used in rural areas is the electric fence. I got everything I need to run four strands of wire completely around the garden for less than sixty dollars. That includes wire, insulators and a few t-posts. I already had the controller but controllers are relatively inexpensive as well. There are drawbacks to a hot wire fence.
Tall grass can short out a hot wire when it gets wet.
And when it does get shorted, it provides no protection from marauding critters. Also, speaking as one who has felt the wrath of the hot wire, a high voltage jolt of electricity running through the body is no fun at all, neither for man nor for beast. Do your homework if you plan to install a hot wire fence. There are lots of mistakes that can be made. I'll try to have an article on hot wire fences later this season.