Confused - it looks to me like what you're trying to do is similar to the way an SSI script is parsed by the webserver. No you do not have to specify an output file - you can just do a regular print statement. When you run a perl script (or any CGI for that matter) the CGI's stdout is sent straight to the viewers browser. This allows you to do something like:
#!/usr/bin/perl
use CGI;
print header();
print "This text will show up in the users browser\n";
Hope that helps!
-Adam Stanley
Nethosters, Inc.