We study homoclinic bifurcation of limit cycles in perturbed planar Hamiltonian systems. Suppose that a homoclinic loop is defined by H=hsH=hs. Our main result is that a new method is established for computing the coefficients of the expansion of Melnikov functions at h=hsh=hs. Then by using those coefficients, more limit cycles would be found around homoclinic loops. An example is also provided to illustrate our method.