You are not executing the code; all you are doing is opening it and reading the file. To call the code and get the results, as you want you need to use back ticks.
$test = `test_two.pl`;
Read the
CGI tutorials to get yourself off to a good start.
Good luck
Josh
UPDATE: fixed newlines...