/usr/share/doc/libnet-cups-perl/examples/print_file.pl is in libnet-cups-perl 0.61-2+b3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #!/usr/bin/perl
##
## This is a *simple* example with minimal error checking of how to
## print a file.
##
use strict;
use warnings;
use Net::CUPS;
use Net::CUPS::Destination;
{
die( "Please give me the name of a file to print!\n" ) if ( @ARGV < 1 );
my $filename = $ARGV[0];
my $cups = Net::CUPS->new();
my $dest = $cups->getDestination();
die( "You don't have a default printer setup!\n" ) if( !defined( $dest ) );
print "I am attempting to print $filename to " . $dest->getName() . ".\n";
$dest->printFile( $filename, "Net::CUPS Test Print!" );
exit( 0 );
}
|