in reply to Strange one! Perl's or Apache's problem?!?

@files = <../data/texts/*.txt>;
This assumes the current working directory is appropriate. Most likely, when run as a CGI process, the current working directory is quite different from when you run it from the command line.

Abigail