(unknown)

(unknown)

am 08.05.2008 10:47:54 von VDI Freemail

Deane,

try =


=


# Printer_available.pl listet alle verfügbaren Drucker und die
dazugehörigen

# Ports auf den aktuellen Rechner

=


use Printer;

$prn =3D new Printer('linux' =3D> 'lp',

'MSWin32' =3D> 'LPT1',

$OSNAME =3D> 'Printer');

%available_printers =3D $prn->list_printers;

=


print "Verfügbare Drucker\n";

printf ("%3s %40s\t%s\n", 'Nr.', 'Name', 'Port');

print "-" x 70, "\n";

=


foreach $i (0 .. $#{$available_printers{'name'}})

{printf ("%3d %40s\t", $i, $available_printers{'name'}[$i]);

print "$available_printers{'port'}[$i]\n";

}

=


Generates the output

=


Verfügbare Drucker

Nr. Name Port

------------------------------------------------------------ ---------------=
----------------

0 A3H =

EG_Olivetti_D300_30.0.0.87

1 A4H =

EDV_IP_30.0.0.249

2 Color LaserJet 4500 PCL Vertrieb =

COLOR_Vertrieb_IP_30.0.0.220

3 DesignJet 800 24 by HP =

Farbe_TB_30.0.0.126

4 EDV HP LaserJet 1015 PCL 5e lokal EDV_IP_30.0.0.249

5 EG_Olivetti d-Copia 300 KX =

EG_Olivetti_D300_30.0.0.87

6 FinePrint FPR5:

7 Microsoft Office Document Image Writer Microsoft Document
Imaging Writer Port:

8 OG_Kyocera KM-3050 KX OG_Kyocera_30.0.0.88

9 PDFCreator PDFCreator:

=


If you have problems like this

=


Can't locate Printer.pm in @INC (@INC contains: C:/Perl/site/lib
C:/Perl/lib .)

at d:\Help\perl\Printer_available.pl line 4.

BEGIN failed--compilation aborted at d:\Help\perl\Printer_available.pl
line 4.

=


copy printer.pm from C:\Perl\site\lib to C:\Perl\site\lib\win32 after
installing Printer-0.98.zip

=


Manfred

=




_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs