File: example-client-no-introspect.pl

package info (click to toggle)
libnet-dbus-perl 0.33.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 692 kB
  • ctags: 422
  • sloc: perl: 4,714; makefile: 50; sh: 34
file content (26 lines) | stat: -rw-r--r-- 666 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
24
25
26
#/usr/bin/perl

use warnings;
use strict;

use Net::DBus;
use Carp qw(cluck carp);
#$SIG{__WARN__} = sub { cluck $_[0] };
#$SIG{__DIE__} = sub { carp $_[0] };

my $bus = Net::DBus->session();

my $service = $bus->get_service("org.designfu.SampleService");
my $object = $service->get_object("/SomeObject", "org.designfu.SampleInterface");

my $list = $object->HelloWorld("Hello from example-client.pl!");

print "[", join(", ", map { "'$_'" } @{$list}), "]\n";

my $tuple = $object->GetTuple();

print "(", join(", ", map { "'$_'" } @{$tuple}), ")\n";

my $dict = $object->GetDict();

print "{", join(", ", map { "'$_': '" . $dict->{$_} . "'"} keys %{$dict}), "}\n";