<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: line wrap or truncate when printing web page produced by perl pgm in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021953#M97130</link>
    <description>&lt;!--!*#--&gt;&lt;BR /&gt;My first step woudl be to isolate the problem into two parts.&lt;BR /&gt;&lt;BR /&gt;part 1) The perl script to generate the HTML.&lt;BR /&gt;&lt;BR /&gt;part 2) a Browser displaying and printing the page.&lt;BR /&gt;&lt;BR /&gt;In between you have the html file.&lt;BR /&gt;Study that with vi or some such.&lt;BR /&gt;Is it exactly what you want it to be?&lt;BR /&gt;If not, fix the perl,&lt;BR /&gt;be first make it how you want it to be with an editor and verify it works as intended.&lt;BR /&gt;&lt;BR /&gt;If the html looks alright, as intended, then it is not a perl/hpux question but an html language question. (What does PRE do? Don't you need a &lt;P&gt; around paragraphs? )&lt;BR /&gt;&lt;BR /&gt;No go get a bunch of wet noodles out of a cupboard and wack yourself on the hands a few times for extremely poor programming style.&lt;BR /&gt;It's just not reasonable to fork a process (backtick); activate a program (cat); make it read a file, send it to a pipe to then have perl read it from that pipe when perl can just read the file directly and with much better options for error handling!&lt;BR /&gt;It's... it's.. dare I say this... embarrasing to do otherwise&lt;BR /&gt;&lt;BR /&gt;Just use something like:&lt;BR /&gt; &lt;BR /&gt;$file = shift; # or wherever else you get the name from.&lt;BR /&gt;if (open (HTML, "&amp;gt;$html") {&lt;BR /&gt;  print HTML "&lt;PRE&gt;\n" # and more ?&lt;BR /&gt;  if (open( FILE, "&amp;lt;$file")) {&lt;BR /&gt;    while (&lt;FILE&gt;) {&lt;BR /&gt;      print HTML $_; # yes you can write this faster&lt;BR /&gt;    }&lt;BR /&gt;  } else {&lt;BR /&gt;    # input file error handling&lt;BR /&gt;  }&lt;BR /&gt;} else {&lt;BR /&gt;  # html file create error handling&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FILE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2007 17:13:45 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-01-09T17:13:45Z</dc:date>
    <item>
      <title>line wrap or truncate when printing web page produced by perl pgm</title>
      <link>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021951#M97128</link>
      <description>I have a simple perl program to produce a web page. The contents of the web page are a listing of a text file. In the perl program I'm just using the backticks to invoke the cat command to list the file contents, and enclosing that within the html tags &lt;PRE&gt; &lt;/PRE&gt;.&lt;BR /&gt;&lt;BR /&gt;In the browser, long lines display fine, - user can scroll right to view long lines. But if the user prints the page, the long lines get truncated. I need the lines to be wrapped, not truncated, when the page is printed.&lt;BR /&gt;&lt;BR /&gt;Is there a simple way around this? I don't care whether it gets adressed as a browser (IE) setting, a printer page setup change, a different way of generating the web page, etc. Just hoping it can be accomplished with a simple change.</description>
      <pubDate>Tue, 09 Jan 2007 16:44:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021951#M97128</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2007-01-09T16:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: line wrap or truncate when printing web page produced by perl pgm</title>
      <link>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021952#M97129</link>
      <description>Hi John:&lt;BR /&gt;&lt;BR /&gt;I think you need to "smarten" you code.  Instead of invoking the external 'cat', open and read the file into an array.  Assuming that you can compress whitespace and/or split lines, use the 'Test::Wrap' module (available in the core distribution) to reduce the margin's extent.  If the data is columnar with fixed whitespace widths, you may be forced to reading and reformatting it yourself.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 09 Jan 2007 17:07:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021952#M97129</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-01-09T17:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: line wrap or truncate when printing web page produced by perl pgm</title>
      <link>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021953#M97130</link>
      <description>&lt;!--!*#--&gt;&lt;BR /&gt;My first step woudl be to isolate the problem into two parts.&lt;BR /&gt;&lt;BR /&gt;part 1) The perl script to generate the HTML.&lt;BR /&gt;&lt;BR /&gt;part 2) a Browser displaying and printing the page.&lt;BR /&gt;&lt;BR /&gt;In between you have the html file.&lt;BR /&gt;Study that with vi or some such.&lt;BR /&gt;Is it exactly what you want it to be?&lt;BR /&gt;If not, fix the perl,&lt;BR /&gt;be first make it how you want it to be with an editor and verify it works as intended.&lt;BR /&gt;&lt;BR /&gt;If the html looks alright, as intended, then it is not a perl/hpux question but an html language question. (What does PRE do? Don't you need a &lt;P&gt; around paragraphs? )&lt;BR /&gt;&lt;BR /&gt;No go get a bunch of wet noodles out of a cupboard and wack yourself on the hands a few times for extremely poor programming style.&lt;BR /&gt;It's just not reasonable to fork a process (backtick); activate a program (cat); make it read a file, send it to a pipe to then have perl read it from that pipe when perl can just read the file directly and with much better options for error handling!&lt;BR /&gt;It's... it's.. dare I say this... embarrasing to do otherwise&lt;BR /&gt;&lt;BR /&gt;Just use something like:&lt;BR /&gt; &lt;BR /&gt;$file = shift; # or wherever else you get the name from.&lt;BR /&gt;if (open (HTML, "&amp;gt;$html") {&lt;BR /&gt;  print HTML "&lt;PRE&gt;\n" # and more ?&lt;BR /&gt;  if (open( FILE, "&amp;lt;$file")) {&lt;BR /&gt;    while (&lt;FILE&gt;) {&lt;BR /&gt;      print HTML $_; # yes you can write this faster&lt;BR /&gt;    }&lt;BR /&gt;  } else {&lt;BR /&gt;    # input file error handling&lt;BR /&gt;  }&lt;BR /&gt;} else {&lt;BR /&gt;  # html file create error handling&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FILE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2007 17:13:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021953#M97130</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-01-09T17:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: line wrap or truncate when printing web page produced by perl pgm</title>
      <link>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021954#M97131</link>
      <description>Thanks JRF.&lt;BR /&gt;&lt;BR /&gt;I'll see what I can do with Text::Wrap.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Jan 2007 18:33:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021954#M97131</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2007-01-09T18:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: line wrap or truncate when printing web page produced by perl pgm</title>
      <link>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021955#M97132</link>
      <description>Text::Wrap worked out nicely and was fairly quick and easy.</description>
      <pubDate>Tue, 09 Jan 2007 19:50:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/line-wrap-or-truncate-when-printing-web-page-produced-by-perl/m-p/5021955#M97132</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2007-01-09T19:50:22Z</dc:date>
    </item>
  </channel>
</rss>

