1234567891011121314
use warnings;use strict;use Win32::API;my $winspool_path = 'winspool.drv';my $printer_name_size = 256;my $printer_name = " " x $printer_name_size; # Speicher allozierenmy $GetDefaultPrinter = Win32::API->new($winspool_path, 'GetDefaultPrinter', 'PP', 'I');$GetDefaultPrinter->Call($printer_name, $printer_name_size);print $printer_name;