If this is a script that is executed whenever a request comes in (i.e., no mod_perl or other persistent framework), you could do something like:
- Slurp STDIN into a scalar in a BEGIN block.
- Log the scalar.
- Use IO::Scalar to treat the scalar like a filehandle.
- Reassign STDIN to the scalar-filehandle.
As for reassigning, you may be looking for something like open( STDIN, '<<', $scalar ); I'm grabbing this from p.442 of the Camel 3rd edition section on Interprocess Communication.
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.