I sometimes need to do this when driving another application from perl that I don't actually control. Really, the right way to do this would be to modify your "second.pl" script to be smarter about the way it takes input, but that's another post.
Try the following:
#run the perl interpreter and open it's STDIN like a filehandle
open PL, "|perl second.pl";
# whatever your loop/control structure is goes here
while()
{
.
.
#print your input to the "filehandle", this has the effect
#of sending your input via STDIN to the script
print PL "Something";
.
.
}
close PL;
HTH =)
~CubicSpline
"No one tosses a Dwarf!"