I think people have mentioned using LWP [perldoc.com] for these types of operations.
Hopefully someone can come flush out the info. :)
RewriteEngine On
RewriteRule ^.*\/your_regex_here\.cgi$ /your_path/jollyo.cgi [L]
This way, all happens without redirects, both server & client side.
Note: you can do this also if you've only a non-privileged account, by using .htaccess.
But if the 2 CGIs are on different servers.. then you need maybe to mimic 100% the behavior of a standard GUI browser. ;)
In other words:
1] user X posts to server A
2] server A posts to server B, acting as 'human-using-IE'
3] server A gets right response from server B
4] server A give response to user X
5] user X gets the response from server A
6] user X has no way at all to know that data, in fact, comes from server B.
7] server B has no way at all [note: at all if server A goes through a proxy i.ex..] to know that data,
in fact, comes from a machine.
It's this your scenario?
If so you can do it a few ways.
First option is if you have not issued a print "Content-type:text/html\n\n"; you can use the print "Location:http://yourdomain.com/cgi-bin/second.cgi?data1=value1&data2=value2";
problem of course is that the post values now are get values.
Second option, if the script is on the same server as the first you can call and exec() or system() command and run it that way - check your perl man pages for those or go to perldoc.com for more detail on those commands.
Third option as jatar_k mentioned is to use LWP or another perl mod (see search.cpan.org for more mods).
Scott Geiger