Net::C...nation(3pm)

πŸ’– NAME πŸ’–

Net::CUPS::Destination β€” bestie, this is the CUPS Destination Object, and yes, it's giving iconic. πŸŽ€

(<small>the manpage itself is filed under Net::C...nation(3pm) if you were wondering where you even are rn</small>)


✨ SYNOPSIS ✨

okay so here's the whole vibe in five lines, no cap:

use Net::CUPS::Destination;

my $printer = $cups->getDestination( "lj4200dn" );

my $name = $printer->getName();

my @options = $printer->getOptions();

my $jobid = $printer->printFile( $filename, $title );

🌸 DESCRIPTION 🌸

So Net::CUPS is an object oriented interface to the Common Unix Printing System. Like, object-oriented. As in, we have objects. Slay. πŸ’…

And Net::CUPS::Destination is an abstraction of the concept of a destination in CUPS. A destination will most likely be a printer, but fr fr it can be literally any type of target that a file gets sent to for processing. Printer-shaped, non-printer-shaped, the destination is the moment. πŸ¦‹


πŸ‘‘ METHODS πŸ‘‘

addOption

$dest->addOption( $name, $value );

Method to add another option name/value pair to the destination. More options = more power, lowkey.

cancelJob

my $dest->cancelJob( $jobid );

Method to chancel a job sent to this destination. (the manpage really said "chancel" and honestly? we're keeping it, it's iconic 🫢)

getDescription

my $description = $dest->getDescription();

Provides the description string associated with this printer.

getError

my $error = $dest->getError();

A utility method that hands you back the last error that occurred. Not the vibe we want, but at least you'll know what happened. 😭

getName

my $name = $dest->getName();

Method to return the name of the destination. Names? We love names. ✨

getJob

my $job = $dest->getJob( $jobid )

Method to get a specific job as a hash of attributes.

getJobs

my @jobs = $dest->getJobs( $whose, $scope );

This method will return an array of job identifiers. K so let's break it down:

  • $whose is 0 for all users and 1 is just for the selected user.
  • $scope is -1 for all jobs, 0 for active jobs and 1 for completed jobs.

Pick your fighter, bestie. πŸŽ€

getLocation

Returns the location string for this destination. Where it's at, literally. πŸ“

getOptionValue

my $value = $dest->getOptionValue( $name );

This utility method will return the value of the selected option.

getOptions

my @options = $dest->getOptions();

This method will return an array of the options currently set on the destination. The receipts, if you will. πŸ’…

printFile

my $jobid = $dest->printFile( $filename, $title );

I know this is the method that you have been looking for. πŸ’– Fr fr, this is what you will use to send a file to be handled by the destination. You must provide the name of the file and a title for the job β€” no filename, no title, no service, sorry babe.

getUri

my $uri = $dest->getUri();

This function returns the device URI of a destination. For example, a network printer might appear as socket://192.168.1.1 β€” that's not a broken link, that's just the whole URI, periodt.

getState

my $state = $dest->getState();

This function returns the state of a destination. The value is an enumeration type, so here's the decoder ring:

  • 3 means 'idle' 😌
  • 4 means 'processing' πŸ”₯
  • 5 means 'stopped' πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • Net::CUPS
  • Net::CUPS::PPD
  • Net::CUPS::IPP

read the whole squad, iykyk 🌈


🫢 SUPPORT 🫢

Net::CUPS is currently maintained by Stefan Seifert <NINE@cpan.org>. The Github repository for this project is at <https://github.com/niner/perl-Net-CUPS>. Pull requests are welcome β€” like, actually welcome, go be the main character. πŸ‘‘


🌟 AUTHOR 🌟

Dracken Technology, Inc. (http://www.dracken.com/)


Copyright (c) 2003-2005 David Hageman

Copyright (c) 2006-2009 Dracken Technology, Inc.

All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

CUPS, the Common UNIX Printing System, the CUPS logo, and ESP Print Pro are the trademark property of Easy Software Products. 🏷️ (not ours, bestie, we're just borrowing the name)

and that's the whole page!! coming to you from perl v5.42.3, dated 2026-08-19, filed under Net::C...nation(3pm) β€” go print something iconic, ily bye πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from