http://qs321.pair.com?node_id=76462


in reply to Re: Problem with tie *STDIN, 'IO::Scalar', \$text;
in thread Problem with tie *STDIN, 'IO::Scalar', \$text;

Well I don't know cuz you didn't show the real problem you are trying to solve and the assosiated code.

pod2html() function from Pod::Html uses implicit inputs and outputs.
It could have been pod2html($fh_pod_input, $fh_html_output).


But it is not, and hence my problem.
I want to feed text from a scalar variable to a subroutine that reads from STDIN. Specifically, I want to convert some pod text from a scalar variable to a html file, using Pod::Html::pod2html.

This here does the job, but it uses a script pod2html.pl that wraps the sub Pod::Html::pod2html:
sub string2Html { my ($htmlfilename, $podtext) = @_; open PIPE, "| pod2html --outfile $htmlfilename"; # works, because there is a pod2html.bat print PIPE $podString; close PIPE; }
I would like to replace it by something like this, not using a separate script and pipes or temporary files:
sub string2Html { my ($htmlfilename, $podtext) = @_; ### some code that causes pod2html to read from scalar \$podtext; ### when it wants to read from STDIN Pod::Html::pod2html "--outfile $htmlfilename"; ### code to wrap up }
I hope that this clarifies what I am trying to solve.

Rudif