You haven't told us what it's failing to do. So I can only guess given what you've shown us.
Here are some thoughts:
- You aren't declaring $addr with 'my'. So it won't run under strictures.
- Your 'die' output complains about HANDLE_IN but you open a filehandle called LISTING. Not a fatal error, but an inconsistancy nevertheless.
- You're using $line and @line. Also not an error, but definately a possible source of confusion.
- You're passing data straight from a CGI param into a 2-argument open, which could allow tainted (or malicious data) access to the shell.
- You declare $count, but never use it.
- You're assuming that the script's access permissions allow it to execute lynx.
- You're slurping into an array, which wouldn't scale well if the output from lynx were to grow large.
- If, in fact, this is the entire script, you've forgotten to 'use' the modules you're trying to use. It looks like CGI.pm is probably on the list of modules you need to 'use'. And you should definately be using the strict and warnings pragmas as well.
Maybe you could tell us what the problem is that you're actually trying to track down... error messages, unexpected results, etc. Otherwise, start trying to cross things off the list above.