Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I wish to list printers using in a web interface running on a unix sysetm. From the command line I can do smbclient -L and list printers etc. Is there a module I can use from CPAN which interfaces with samba to allow me to access this? Thanks
  • Comment on Module for accessing samba smbclient command

Replies are listed 'Best First'.
Re: Module for accessing samba smbclient command
by quester (Vicar) on Dec 14, 2011 at 06:41 UTC

    I don't see a CPAN module offhand, but you might consider a simple-minded approach. What happens if you try

    my $output = qx{smbclient -L}; say $output;
      Thank you. I've got the results in a variable. Here is how it prints with DataDumper:
      $VAR1 = 'Printer1 Printer Printer 1 Printer2 Printer Printer 2 Store Printer Store printer ';
      How can I create an array containing just the printer names (col 1)?