The scope of time-dependent density-functional theory (TDDFT) is limited to the lowest portion of the spectrum of rather small systems (a few tens of atoms at most). In the static regime, density-functional perturbation theory (DFPT) allows one to calculate response functions of systems as large as currently dealt with in ground-state simulations. In this paper we present an effective way of combining DFPT with TDDFT. The dynamical polarizability is first expressed as an off-diagonal matrix element of the resolvent of the Kohn-Sham Liouvillian super-operator. A DFPT representation of response functions allows one to avoid the calculation of unoccupied Kohn-Sham orbitals. The resolvent of the Liouvillian is finally conveniently evaluated using a newly developed non-symmetric Lanczos technique, which allows for the calculation of the entire spectrum with a single Lanczos recursion chain. Each step of the chain essentially requires twice as many operations as a single step of the iterative diagonalization of the unperturbed Kohn-Sham Hamiltonian or, for that matter, as a single time step of a Car-Parrinello molecular dynamics run. The method will be illustrated with a few case molecular applications.