As you've probably already guessed, this means it can't find the files
necessary for interfacing with Postgres. The directories you've entered
are almost certainly bogus and I strongly suspect that the first prompts
asking for 'the valid version' already occur because the files can't be
found. You will need to determine why it doesn't find them. What I'd do
in this case would be to download (manually) the DBD::Pg source
distribution and attempt a build via
perl Makefile.PL
make
This should display the command it's actually executing (instead of the
crap quoted above) and from there, it should be possible to work out
what's going on here, eg, by running a failing command via strace and
looking for libpq-fe.h related errors in the output.