home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / libnet-dbus-perl / examples / dump-object.pl next >
Encoding:
Perl Script  |  2006-02-19  |  392 b   |  24 lines

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