We study the Dirichlet problem for the p(x)-Laplacian, in the case when the variable exponent $ p(x)$ is infinite in a subdomain $ D$. The main issue is to give a proper sense to what a solution is. To this end, we consider the limit of the solutions $ u_n$ to the corresponding problem when $ p_n(x) = {\rm min}
(p(x),n)$, in particular, with $ p_n=n$ in $ D$. Under suitable assumptions on the data, we find that such a limit exists and that it can be characterized as the unique solution of a variational minimization problem. Moreover, we examine this limit in the viscosity sense and find an equation it satisfies.