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 / example-client-no-introspect.pl < prev    next >
Encoding:
Perl Script  |  2006-02-19  |  639 b   |  24 lines

  1. #/usr/bin/perl
  2.  
  3. use Net::DBus;
  4. use Carp qw(cluck carp);
  5. #$SIG{__WARN__} = sub { cluck $_[0] };
  6. #$SIG{__DIE__} = sub { carp $_[0] };
  7.  
  8. my $bus = Net::DBus->session();
  9.  
  10. my $service = $bus->get_service("org.designfu.SampleService");
  11. my $object = $service->get_object("/SomeObject", "org.designfu.SampleInterface");
  12.  
  13. my $list = $object->HelloWorld("Hello from example-client.pl!");
  14.  
  15. print "[", join(", ", map { "'$_'" } @{$list}), "]\n";
  16.  
  17. my $tuple = $object->GetTuple();
  18.  
  19. print "(", join(", ", map { "'$_'" } @{$tuple}), ")\n";
  20.  
  21. my $dict = $object->GetDict();
  22.  
  23. print "{", join(", ", map { "'$_': '" . $dict->{$_} . "'"} keys %{$dict}), "}\n";
  24.