I think more details are going to be needed to answer this question. Chief among them are:

The UNIX world is used to the BSD printing system; Net::Printer is capable of speaking to that system only (as things currently stand). Odds are better than even that if your printer is attached to a *nix system (e.g. Linux, *BSD, Solaris) that system is running a version of BSD lpr (or at least something that can grok it). My experience with recentish HP standalone networked printers is that their builtin printer server software groks BSD lpr, so you may already be a winner with Net::Printer in these cases.

SMB is the protocol by which a Windows system shares its printer, so if your printer is attached to a Windows system, you'll have to go through SMB at some point. You can ease the pain pretty quickly, though, if you're running a *nix flavor: with Samba (distributed with most *nices today), you mount the remote printer as if it were any other networked printer; all you do once the system's set up is pump your script's output to the right printer with

cat filename | lpr -P[printername]

Finally, if you're on Windows and the printer is also attached to a windows system ... well, here I'm not so sure, 'cos I don't use Perl on Win32 ... I looked through the available modules, but none seemed particularly well suited to the task. You might look into using Win32::OLE, but that seems (a) indirect and (b) like swatting a fly with a sledgehammer.

HTH

Philosophy can be made out of anything. Or less -- Jerry A. Fodor


In reply to Re: How to send output from a Perl script to the printer by arturo
in thread How to send output from a Perl script to the printer by kleinbiker7

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.