and there was the time barney had to play pied piper to a goat , leading it out of town with a harmonica because it had eaten a box of dynamite. ; `` mayberry was about the best things of small-town life when there were still small towns left , '' andy griffith , who also helped write the show , said in a recent interview. ; `` every problem could be solved in a half-hour and usually by someone taking an interest in someone else , '' he added. ;