  We study the Dirichlet problem in a domain with a small hole close to the
boundary. To do so, for each pair $\boldsymbol\varepsilon = (\varepsilon_1,
\varepsilon_2 )$ of positive parameters, we consider a perforated domain
$\Omega_{\boldsymbol\varepsilon}$ obtained by making a small hole of size
$\varepsilon_1 \varepsilon_2 $ in an open regular subset $\Omega$ of
$\mathbb{R}^n$ at distance $\varepsilon_1$ from the boundary $\partial\Omega$.
As $\varepsilon_1 \to 0$, the perforation shrinks to a point and, at the same
time, approaches the boundary. When $\boldsymbol\varepsilon \to (0,0)$, the
size of the hole shrinks at a faster rate than its approach to the boundary. We
denote by $u_{\boldsymbol\varepsilon}$ the solution of a Dirichlet problem for
the Laplace equation in $\Omega_{\boldsymbol\varepsilon}$. For a space
dimension $n\geq 3$, we show that the function mapping $\boldsymbol\varepsilon$
to $u_{\boldsymbol\varepsilon}$ has a real analytic continuation in a
neighborhood of $(0,0)$. By contrast, for $n=2$ we consider two different
regimes: $\boldsymbol\varepsilon$ tends to $(0,0)$, and $\varepsilon_1$ tends
to $0$ with $\varepsilon_2$ fixed. When $\boldsymbol\varepsilon\to(0,0)$, the
solution $u_{\boldsymbol\varepsilon}$ has a logarithmic behavior; when only
$\varepsilon_1\to0$ and $\varepsilon_2$ is fixed, the asymptotic behavior of
the solution can be described in terms of real analytic functions of
$\varepsilon_1$. We also show that for $n=2$, the energy integral and the total
flux on the exterior boundary have different limiting values in the two
regimes. We prove these results by using functional analysis methods in
conjunction with certain special layer potentials.
