Perl extension for direct-to-lpd printing.
Version: 1.05Net::Printer is a Perl module for directly printing to a print server/printer without having to create a pipe to either lpr or lp. This essentially mimics what the BSD LPR program does by connecting directly to the line printer printer port (almost always 515), and transmitting the data and control information to the print server.
License: Perl Artistic License
Operating System: Linux
Please note that this module only talks to print servers that speak BSD. It will not talk to printers using SMB or SysV unless they are set up as BSD printers. CUPS users will need to set up cups-lpd to provide legacy access.
# Create new Printer Object
$lineprinter = new Net::Printer(
filename => "/home/jdoe/myfile.txt",
printer => "lp",
server => "printserver",
port => 515,
lineconvert => "YES"
# Print the file
$result = $lineprinter->printfile();
# Optionally print a file
$result = $lineprinter->printfile("/home/jdoe/myfile.txt");
# Print a string
$lineprinter->printstring("Smoke me a kipper, I'll be back for breakfast.");
# Did I get an error?
$errstr = $lineprinter->printerror();
# Get Queue Status
@result = $lineprinter->queuestatus();