in reply to errors revisited

I would look at this error first:
Undefined subroutine &Carp::longmess called at C:\PERL\lib/Carp.pm lin +e 296.
It seems that your Carp.pm is attempting to call two subroutines longmess and shortmess. There might be a probem with your installation of Carp.

Update: The above was wrong

Update:

open(PAGES, "<pages.txt") || die $!; @pages = PAGES; close(PAGES);
should be
open(PAGES, "<pages.txt") || die $!; @pages = <PAGES>; close(PAGES);
And then look at damian1301's response.