File: dump-object-xml.pl

package info (click to toggle)
libnet-dbus-perl 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 720 kB
  • sloc: perl: 4,919; sh: 34; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

use warnings;
use strict;

use Net::DBus;
use Net::DBus::Dumper;
use Carp qw(confess);

$SIG{__DIE__} = sub {confess $_[0] };

my $bus = Net::DBus->find;

if (int(@ARGV) != 2) {
    die "syntax: $0 SERVICE OBJECT";
}

my $service = $bus->get_service(shift @ARGV);
my $object = $service->get_object(shift @ARGV);
my $xml = $object->_introspector->format();
print $xml, "\n";