home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / libnet-dbus-perl / examples / dump-object.pl < prev    next >
Encoding:
Perl Script  |  2008-02-20  |  419 b   |  27 lines

  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5.  
  6. use Net::DBus;
  7. use Net::DBus::Dumper;
  8. use Carp qw(confess);
  9.  
  10. $SIG{__DIE__} = sub {confess $_[0] };
  11.  
  12. my $bus = Net::DBus->find;
  13.  
  14. if (@ARGV) {
  15.     my $service = $bus->get_service(shift @ARGV);
  16.     
  17.     if (@ARGV) {
  18.     my $object = $service->get_object(shift @ARGV);
  19.     print dbus_dump($object);
  20.     } else {
  21.     print dbus_dump($service);
  22.     }
  23. } else {
  24.     print dbus_dump($bus);
  25. }
  26.  
  27.