Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Module for accessing samba smbclient command

by Anonymous Monk
on Dec 13, 2011 at 15:36 UTC ( #943368=perlquestion: print w/replies, xml ) Need Help??

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)?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://943368]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2022-06-26 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (86 votes). Check out past polls.

    Notices?