Complex integral, 2 problems

1)I must calculate $\displaystyle \int _{|z|=1} \frac{\cos (e^{-z})}{z^2} dz$. I'm not sure if I should see it as the real part of $\displaystyle \int _{|z|=1} \frac{e^ {i (e^{-z})}}{z^2} dz$.

Anyway the problem is obviously when $\displaystyle z=0$.

I get an infinite residue: $\displaystyle Res(f,z=0)=\lim _{z \to 0} \frac{\cos (e^{-z})}{z}=+\infty$.

2)I'd like to get an example of a real integral where when I use complex analysis methods and I choose a contour of integration, I fall over a singularity on the real axis.

Thanks in advance.