⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
libnet-dbus-perl
/
examples
/
View File Name :
strict-exports.pl
#!/usr/bin/perl # -*- perl -*- use strict; use warnings; package MyStrictObject; use base qw(Net::DBus::Object); use Net::DBus::Exporter "org.example.MyObject"; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->{name} = "Joe"; $self->{salary} = 100000; bless $self, $class; return $self; } dbus_method("name", [], ["string"]); sub name { my $self = shift; return $self->{name}; } sub salary { my $self = shift; return $self->{salary}; } package MyFlexibleObject; use base qw(Net::DBus::Object); use Net::DBus::Exporter qw(org.example.MyObject); dbus_no_strict_exports; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->{name} = "Joe"; $self->{salary} = 100000; bless $self, $class; return $self; } dbus_method("name", [], ["string"]); sub name { my $self = shift; return $self->{name}; } sub salary { my $self = shift; return $self->{salary}; } package main; use Net::DBus; use Net::DBus::Reactor; my $bus = Net::DBus->session; my $service = $bus->export_service("org.cpan.Net.Bus.test"); my $object1 = MyStrictObject->new($service, "/org/example/MyStrictObject"); my $object2 = MyFlexibleObject->new($service, "/org/example/MyFlexibleObject"); Net::DBus::Reactor->main->run();