in reply to Win32::Printer::Enum - can't find network printer

You're supposed to use
my @printer = Printers( $server );
It can be confusing, but in this case, the brackets mean optional arguments (see Re: Function signatures in POD-headlines/pseudo code! Is there a standard?)

Replies are listed 'Best First'.
Re^2: Win32::Printer::Enum - can't find network printer
by simonask (Initiate) on Aug 27, 2010 at 14:04 UTC

    ah! thanks for the info.

    #!/usr/bin/perl -w use strict; use Win32::Printer::Enum; use Win32::Printer::Enum qw( Jobs ); my $server = 'sfile'; my @printer = Printers($server); my $count_printer = @printer; print $count_printer;

    gives 0
    still doesn't find network printer... this runs on win7..hm any clue is welcome

      Looking at the underlying Win32 API method EnumPrinters, you could try passing in the string

      'Print Provider!!\\Machine'

      to search the machine \\Machine for printers.

      In your case, that could be:

      my @printer = Printers("Print Provider!!\\\\$server");
        thanks ahead
        my @printer = Printers("Print Provider!!\\\\$server");
        didn't work but
        my @printer = Printers("\\\\$server");

        works !
        love and peace~

      Try '//sfile'? Also check your event viewer logs for hints