Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2024-04-18 13:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found