hi janos,
I'm not sure if there is a specific reason you want to load the 123.pdf from a cgi script (if there is then probably stop reading here).
If you simply give the "http://myserver.com/test/123.pdf" as a link the http will automatically serve up the .pdf object (ie. so that when a user clicks on a link -- the 123.pdf file will automatically download).
There is not so much need to use the CGI module -- http is built to retrieve and serve objects such as this.
This has been my experience. I hope it helps.
Best of Luck,