Is this "so simple" in other cross-platform interpreted languages? It's a challenge because every platform handles printing in a remarkably different manner.

Sometimes it is simple in Perl, like on Unix:

#Send raw data to printer on Parallel Port 0: open PRINTER, '>>', '/dev/lp0'; print PRINTER $data; close PRINTER; #Send data to lpd for printing open PRINTER, "|lpr -P $printer"; print PRINTER $data; close PRINTER;

It's more difficult on Win32 and some other systems, because there are not convenient device files and scriptable print programs to work with. This isn't a shortcoming of Perl, it's a shortcoming of an OS that requires a plethora of system-library hooks just to print.


<<UPDATE:
Corion points out that Win32 systems can use the 'LPTn:' "special files", which work much like /dev/lpN files in *NIX. And, it appears that W2K finally has a scriptable print-spool command as well.

So, I stand corrected: Perl can easily print on many an OS with ease, so the main question shows more a lack of understanding of the underlying OS than an issue with Perl.
UPDATE ;


As an aside, you're fortunate I'm in a good mood today, otherwise I doubt you'd get an answer -- your comment is inflamatory, and you've asked for replies to your e-mail address. The former is just rude when you're asking for help, and the latter is both rude and unadvisable unless you want your Hotmail account filled with more Spam than usual. It's not like Google and other search engines don't index the Monestary, you know...

radiantmatrix
require General::Disclaimer;
"Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy

In reply to Re: Trying to Print a File by radiantmatrix
in thread Trying to Print a File by GThorne

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.