home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / perl5 / Net / DBus.pm
Encoding:
Perl POD Document  |  2006-11-05  |  16.7 KB  |  739 lines

  1. # -*- perl -*-
  2. #
  3. # Copyright (C) 2004-2006 Daniel P. Berrange
  4. #
  5. # This program is free software; You can redistribute it and/or modify
  6. # it under the same terms as Perl itself. Either:
  7. #
  8. # a) the GNU General Public License as published by the Free
  9. #   Software Foundation; either version 2, or (at your option) any
  10. #   later version,
  11. #
  12. # or
  13. #
  14. # b) the "Artistic License"
  15. #
  16. # The file "COPYING" distributed along with this file provides full
  17. # details of the terms and conditions of the two licenses.
  18.  
  19. =pod
  20.  
  21. =head1 NAME
  22.  
  23. Net::DBus - Perl extension for the DBus message system
  24.  
  25. =head1 SYNOPSIS
  26.  
  27.  
  28.   ####### Attaching to the bus ###########
  29.  
  30.   use Net::DBus;
  31.  
  32.   # Find the most appropriate bus
  33.   my $bus = Net::DBus->find;
  34.  
  35.   # ... or explicitly go for the session bus
  36.   my $bus = Net::DBus->session;
  37.  
  38.   # .... or explicitly go for the system bus
  39.   my $bus = Net::DBus->system
  40.  
  41.  
  42.   ######## Accessing remote services #########
  43.  
  44.   # Get a handle to the HAL service
  45.   my $hal = $bus->get_service("org.freedesktop.Hal");
  46.  
  47.   # Get the device manager
  48.   my $manager = $hal->get_object("/org/freedesktop/Hal/Manager",
  49.                  "org.freedesktop.Hal.Manager");
  50.  
  51.   # List devices
  52.   foreach my $dev (@{$manager->GetAllDevices}) {
  53.       print $dev, "\n";
  54.   }
  55.  
  56.  
  57.   ######### Providing services ##############
  58.  
  59.   # Register a service known as 'org.example.Jukebox'
  60.   my $service = $bus->export_service("org.example.Jukebox");
  61.  
  62.  
  63. =head1 DESCRIPTION
  64.  
  65. Net::DBus provides a Perl API for the DBus message system.
  66. The DBus Perl interface is currently operating against
  67. the 0.32 development version of DBus, but should work with
  68. later versions too, providing the API changes have not been
  69. too drastic.
  70.  
  71. Users of this package are either typically, service providers
  72. in which case the L<Net::DBus::Service> and L<Net::DBus::Object>
  73. modules are of most relevance, or are client consumers, in which
  74. case L<Net::DBus::RemoteService> and L<Net::DBus::RemoteObject>
  75. are of most relevance.
  76.  
  77. =head1 METHODS
  78.  
  79. =over 4
  80.  
  81. =cut
  82.  
  83. package Net::DBus;
  84.  
  85. use 5.006;
  86. use strict;
  87. use warnings;
  88.  
  89. BEGIN {
  90.     our $VERSION = '0.33.4';
  91.     require XSLoader;
  92.     XSLoader::load('Net::DBus', $VERSION);
  93. }
  94.  
  95. use Net::DBus::Binding::Bus;
  96. use Net::DBus::Service;
  97. use Net::DBus::RemoteService;
  98. use Net::DBus::Test::MockConnection;
  99. use Net::DBus::Binding::Value;
  100.  
  101. use vars qw($bus_system $bus_session);
  102.  
  103. use Exporter qw(import);
  104.  
  105. use vars qw(@EXPORT_OK %EXPORT_TAGS);
  106.  
  107. @EXPORT_OK = qw(dbus_int16 dbus_uint16 dbus_int32 dbus_uint32 dbus_int64 dbus_uint64
  108.         dbus_byte dbus_boolean dbus_string dbus_double
  109.         dbus_object_path dbus_signature
  110.         dbus_struct dbus_array dbus_dict dbus_variant);
  111.  
  112. %EXPORT_TAGS = (typing => [qw(dbus_int16 dbus_uint16 dbus_int32 dbus_uint32 dbus_int64 dbus_uint64
  113.                   dbus_byte dbus_boolean dbus_string dbus_double
  114.                   dbus_object_path dbus_signature
  115.                   dbus_struct dbus_array dbus_dict dbus_variant)]);
  116.  
  117. =item my $bus = Net::DBus->find(%params);
  118.  
  119. Search for the most appropriate bus to connect to and
  120. return a connection to it. The heuristic used for the
  121. search is
  122.  
  123.   - If DBUS_STARTER_BUS_TYPE is set to 'session' attach
  124.     to the session bus
  125.  
  126.   - Else If DBUS_STARTER_BUS_TYPE is set to 'system' attach
  127.     to the system bus
  128.  
  129.   - Else If DBUS_SESSION_BUS_ADDRESS is set attach to the
  130.     session bus
  131.  
  132.   - Else attach to the system bus
  133.  
  134. The optional C<params> hash can contain be used to specify
  135. connection options. The only support option at this time
  136. is C<nomainloop> which prevents the bus from being automatically
  137. attached to the main L<Net::DBus::Reactor> event loop.
  138.  
  139. =cut
  140.  
  141. sub find {
  142.     my $class = shift;
  143.  
  144.     if ($ENV{DBUS_STARTER_BUS_TYPE} &&
  145.     $ENV{DBUS_STARTER_BUS_TYPE} eq "session") {
  146.     return $class->session(@_);
  147.     } elsif ($ENV{DBUS_STARTER_BUS_TYPE} &&
  148.          $ENV{DBUS_STARTER_BUS_TYPE} eq "system") {
  149.     return $class->system(@_);
  150.     } elsif (exists $ENV{DBUS_SESSION_BUS_ADDRESS}) {
  151.     return $class->session(@_);
  152.     } else {
  153.     return $class->system;
  154.     }
  155. }
  156.  
  157. =item my $bus = Net::DBus->system(%params);
  158.  
  159. Return a handle for the system message bus. Note that the
  160. system message bus is locked down by default, so unless appropriate
  161. access control rules are added in /etc/dbus/system.d/, an application
  162. may access services, but won't be able to export services.
  163. The optional C<params> hash can contain be used to specify
  164. connection options. The only support option at this time
  165. is C<nomainloop> which prevents the bus from being automatically
  166. attached to the main L<Net::DBus::Reactor> event loop.
  167.  
  168. =cut
  169.  
  170. sub system {
  171.     my $class = shift;
  172.     unless ($bus_system) {
  173.     $bus_system = $class->_new(Net::DBus::Binding::Bus->new(type => &Net::DBus::Binding::Bus::SYSTEM), @_);
  174.     }
  175.     return $bus_system
  176. }
  177.  
  178. =item my $bus = Net::DBus->session(%params);
  179.  
  180. Return a handle for the session message bus.
  181. The optional C<params> hash can contain be used to specify
  182. connection options. The only support option at this time
  183. is C<nomainloop> which prevents the bus from being automatically
  184. attached to the main L<Net::DBus::Reactor> event loop.
  185.  
  186. =cut
  187.  
  188. sub session {
  189.     my $class = shift;
  190.     unless ($bus_session) {
  191.     $bus_session = $class->_new(Net::DBus::Binding::Bus->new(type => &Net::DBus::Binding::Bus::SESSION), @_);
  192.     }
  193.     return $bus_session;
  194. }
  195.  
  196.  
  197. =item my $bus = Net::DBus->test(%params);
  198.  
  199. Returns a handle for a virtual bus for use in unit tests. This bus does
  200. not make any network connections, but rather has an in-memory message
  201. pipeline. Consult L<Net::DBus::Test::MockConnection> for further details
  202. of how to use this special bus.
  203.  
  204. =cut
  205.  
  206. # NB. explicitly do *NOT* cache, since unit tests
  207. # should always have pristine state
  208. sub test {
  209.     my $class = shift;
  210.     return $class->_new(Net::DBus::Test::MockConnection->new());
  211. }
  212.  
  213. =item my $bus = Net::DBus->new($address, %params);
  214.  
  215. Return a connection to a specific message bus.  The C<$address>
  216. parameter must contain the address of the message bus to connect
  217. to. An example address for a session bus might look like
  218. C<unix:abstract=/tmp/dbus-PBFyyuUiVb,guid=191e0a43c3efc222e0818be556d67500>,
  219. while one for a system bus would look like C<unix:/var/run/dbus/system_bus_socket>.
  220. The optional C<params> hash can contain be used to specify
  221. connection options. The only support option at this time
  222. is C<nomainloop> which prevents the bus from being automatically
  223. attached to the main L<Net::DBus::Reactor> event loop.
  224.  
  225. =cut
  226.  
  227. sub new {
  228.     my $class = shift;
  229.     my $nomainloop = shift;
  230.     return $class->_new(Net::DBus::Binding::Bus->new(address => shift), @_);
  231. }
  232.  
  233. sub _new {
  234.     my $class = shift;
  235.     my $self = {};
  236.  
  237.     $self->{connection} = shift;
  238.     $self->{signals} = [];
  239.     $self->{services} = {};
  240.  
  241.     my %params = @_;
  242.  
  243.     bless $self, $class;
  244.  
  245.     unless ($params{nomainloop}) {
  246.     if (exists $INC{'Net/DBus/Reactor.pm'}) {
  247.         my $reactor = Net::DBus::Reactor->main;
  248.         $reactor->manage($self->get_connection);
  249.     }
  250.     # ... Add support for GLib and POE
  251.     }
  252.  
  253.     $self->get_connection->add_filter(sub { return $self->_signal_func(@_); });
  254.  
  255.     $self->{bus} = Net::DBus::RemoteService->new($self, "org.freedesktop.DBus", "org.freedesktop.DBus");
  256.  
  257.     return $self;
  258. }
  259.  
  260. =item my $connection = $bus->get_connection;
  261.  
  262. Return a handle to the underlying, low level connection object
  263. associated with this bus. The returned object will be an instance
  264. of the L<Net::DBus::Binding::Bus> class. This method is not intended
  265. for use by (most!) application developers, so if you don't understand
  266. what this is for, then you don't need to be calling it!
  267.  
  268. =cut
  269.  
  270. sub get_connection {
  271.     my $self = shift;
  272.     return $self->{connection};
  273. }
  274.  
  275. =item my $service = $bus->get_service($name);
  276.  
  277. Retrieves a handle for the remote service identified by the
  278. service name C<$name>. The returned object will be an instance
  279. of the L<Net::DBus::RemoteService> class.
  280.  
  281. =cut
  282.  
  283. sub get_service {
  284.     my $self = shift;
  285.     my $name = shift;
  286.  
  287.     if ($name eq "org.freedesktop.DBus") {
  288.     return $self->{bus};
  289.     }
  290.  
  291.     my $owner = $name;
  292.     if ($owner !~ /^:/) {
  293.     $owner = $self->get_service_owner($name);
  294.     if (!$owner) {
  295.         $self->get_bus_object->StartServiceByName($name, 0);
  296.         $owner = $self->get_service_owner($name);
  297.     }
  298.     }
  299.  
  300.     unless (exists $self->{services}->{$owner}) {
  301.     $self->{services}->{$owner} = Net::DBus::RemoteService->new($self, $owner, $name);
  302.     }
  303.     return $self->{services}->{$owner};
  304. }
  305.  
  306. =item my $service = $bus->export_service($name);
  307.  
  308. Registers a service with the bus, returning a handle to
  309. the service. The returned object is an instance of the
  310. L<Net::DBus::Service> class.
  311.  
  312. =cut
  313.  
  314. sub export_service {
  315.     my $self = shift;
  316.     my $name = shift;
  317.     return Net::DBus::Service->new($self, $name);
  318. }
  319.  
  320. =item my $object = $bus->get_bus_object;
  321.  
  322. Retrieves a handle to the bus object, C</org/freedesktop/DBus>,
  323. provided by the service C<org.freedesktop.DBus>. The returned
  324. object is an instance of L<Net::DBus::RemoteObject>
  325.  
  326. =cut
  327.  
  328. sub get_bus_object {
  329.     my $self = shift;
  330.  
  331.     my $service = $self->get_service("org.freedesktop.DBus");
  332.     return $service->get_object('/org/freedesktop/DBus',
  333.                 'org.freedesktop.DBus');
  334. }
  335.  
  336.  
  337. =item my $name = $bus->get_unique_name;
  338.  
  339. Retrieves the unique name of this client's connection to
  340. the bus.
  341.  
  342. =cut
  343.  
  344. sub get_unique_name {
  345.     my $self = shift;
  346.  
  347.     return $self->get_connection->get_unique_name
  348. }
  349.  
  350. =item my $name = $bus->get_service_owner($service);
  351.  
  352. Retrieves the unique name of the client on the bus owning
  353. the service named by the C<$service> parameter.
  354.  
  355. =cut
  356.  
  357. sub get_service_owner {
  358.     my $self = shift;
  359.     my $service = shift;
  360.  
  361.     my $bus = $self->get_bus_object;
  362.     my $owner = eval {
  363.     $bus->GetNameOwner($service);
  364.     };
  365.     if ($@) {
  366.     if (UNIVERSAL::isa($@, "Net::DBus::Error") &&
  367.         $@->{name} eq "org.freedesktop.DBus.Error.NameHasNoOwner") {
  368.         $owner = undef;
  369.     } else {
  370.         die $@;
  371.     }
  372.     }
  373.     return $owner;
  374. }
  375.  
  376.  
  377. sub _add_signal_receiver {
  378.     my $self = shift;
  379.     my $receiver = shift;
  380.     my $signal_name = shift;
  381.     my $interface = shift;
  382.     my $service = shift;
  383.     my $path = shift;
  384.  
  385.     my $rule = $self->_match_rule($signal_name, $interface, $service, $path);
  386.  
  387.     push @{$self->{signals}}, [$receiver, $rule, $signal_name, $interface, $service, $path];
  388.     $self->{connection}->add_match($rule);
  389. }
  390.  
  391. sub _remove_signal_receiver {
  392.     my $self = shift;
  393.     my $receiver = shift;
  394.     my $signal_name = shift;
  395.     my $interface = shift;
  396.     my $service = shift;
  397.     my $path = shift;
  398.  
  399.     my $rule = $self->_match_rule($signal_name, $interface, $service, $path);
  400.  
  401.     my @signals;
  402.     foreach (@{$self->{signals}}) {
  403.     if ($_->[0] eq $receiver &&
  404.         defined $_->[1] &&
  405.         $_->[1] eq $rule) {
  406.         $self->{connection}->remove_match($rule);
  407.     } else {
  408.         push @signals, $_;
  409.     }
  410.     }
  411.     $self->{signals} = \@signals;
  412. }
  413.  
  414.  
  415. sub _match_rule {
  416.     my $self = shift;
  417.     my $signal_name = shift;
  418.     my $interface = shift;
  419.     my $service = shift;
  420.     my $path = shift;
  421.  
  422.     my $rule = "type='signal'";
  423.     if ($interface) {
  424.     $rule .= ",interface='$interface'";
  425.     }
  426.     if ($service) {
  427.     if ($service !~ /^:/) {
  428.         # Resolve service name to a client id
  429.         $service = $self->get_service_owner($service);
  430.     }
  431.     if ($service) {
  432.         $rule .= ",sender='$service'";
  433.     }
  434.     }
  435.     if ($path) {
  436.     $rule .= ",path='$path'";
  437.     }
  438.     if ($signal_name) {
  439.     $rule .= ",member='$signal_name'";
  440.     }
  441.     return $rule;
  442. }
  443.  
  444.  
  445. sub _rule_matches {
  446.     my $self = shift;
  447.     my $rule = shift;
  448.     my $member = shift;
  449.     my $interface = shift;
  450.     my $sender = shift;
  451.     my $path = shift;
  452.  
  453.     my %bits;
  454.     map {
  455.     if (/^(\w+)='(.*)'$/) {
  456.         $bits{$1} = $2;
  457.     }
  458.     } split /,/, $rule;
  459.  
  460.  
  461.     if (exists $bits{member} &&
  462.     $bits{member} ne $member) {
  463.     return 0;
  464.     }
  465.     if (exists $bits{interface} &&
  466.     $bits{interface} ne $interface) {
  467.     return 0;
  468.     }
  469.     if (exists $bits{sender} &&
  470.     $bits{sender} ne $sender) {
  471.     return 0;
  472.     }
  473.     if (exists $bits{path} &&
  474.     $bits{path} ne $path) {
  475.     return 0;
  476.     }
  477.     return 1;
  478. }
  479.  
  480. sub _signal_func {
  481.     my $self = shift;
  482.     my $connection = shift;
  483.     my $message = shift;
  484.  
  485.     return 0 unless $message->get_type() == &Net::DBus::Binding::Message::MESSAGE_TYPE_SIGNAL;
  486.  
  487.     my $interface = $message->get_interface;
  488.     my $sender = $message->get_sender;
  489.     my $path = $message->get_path;
  490.     my $member = $message->get_member;
  491.  
  492.     my $handled = 0;
  493.     foreach my $handler (grep { defined $_->[1] &&
  494.                 $self->_rule_matches($_->[1], $member, $interface, $sender, $path) }
  495.              @{$self->{signals}}) {
  496.     my $callback = $handler->[0];
  497.     &$callback($message);
  498.     $handled = 1;
  499.     }
  500.  
  501.     return $handled;
  502. }
  503.  
  504. =back
  505.  
  506. =head1 DATA TYPING METHODS
  507.  
  508. These methods are not usually used, since most services provide introspection
  509. data to inform clients of their data typing requirements. If introspection data
  510. is incomplete, however, it may be neccessary for a client to mark values with
  511. specific data types. In such a case, the following methods can be used. They
  512. are not, however, exported by default so must be requested at import time by
  513. specifying 'use Net::DBus qw(:typing)'
  514.  
  515. =over 4
  516.  
  517. =item $typed_value = dbus_int16($value);
  518.  
  519. Mark a value as being a signed, 16-bit integer.
  520.  
  521. =cut
  522.  
  523. sub dbus_int16 {
  524.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_INT16,
  525.                       $_[0]);
  526.  
  527. }
  528.  
  529. =item $typed_value = dbus_uint16($value);
  530.  
  531. Mark a value as being an unsigned, 16-bit integer.
  532.  
  533. =cut
  534.  
  535.  
  536. sub dbus_uint16 {
  537.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_UINT16,
  538.                       $_[0]);
  539. }
  540.  
  541. =item $typed_value = dbus_int32($value);
  542.  
  543. Mark a value as being a signed, 32-bit integer.
  544.  
  545. =cut
  546.  
  547. sub dbus_int32 {
  548.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_INT32,
  549.                       $_[0]);
  550.  
  551. }
  552.  
  553. =item $typed_value = dbus_uint32($value);
  554.  
  555. Mark a value as being an unsigned, 32-bit integer.
  556.  
  557. =cut
  558.  
  559.  
  560. sub dbus_uint32 {
  561.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_UINT32,
  562.                       $_[0]);
  563. }
  564.  
  565. =item $typed_value = dbus_int64($value);
  566.  
  567. Mark a value as being an unsigned, 64-bit integer.
  568.  
  569. =cut
  570.  
  571.  
  572.  
  573. sub dbus_int64 {
  574.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_INT64,
  575.                       $_[0]);
  576.  
  577. }
  578.  
  579. =item $typed_value = dbus_uint64($value);
  580.  
  581. Mark a value as being an unsigned, 64-bit integer.
  582.  
  583. =cut
  584.  
  585.  
  586.  
  587. sub dbus_uint64 {
  588.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_UINT64,
  589.                       $_[0]);
  590. }
  591.  
  592. =item $typed_value = dbus_double($value);
  593.  
  594. Mark a value as being a double precision IEEE floating point.
  595.  
  596. =cut
  597.  
  598.  
  599.  
  600. sub dbus_double {
  601.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_DOUBLE,
  602.                       $_[0]);
  603. }
  604.  
  605. =item $typed_value = dbus_byte($value);
  606.  
  607. Mark a value as being an unsigned, byte.
  608.  
  609. =cut
  610.  
  611.  
  612.  
  613. sub dbus_byte {
  614.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_BYTE,
  615.                       $_[0]);
  616. }
  617.  
  618. =item $typed_value = dbus_string($value);
  619.  
  620. Mark a value as being a UTF-8 string. This is not usually required
  621. since 'string' is the default data type for any Perl scalar value.
  622.  
  623. =cut
  624.  
  625.  
  626.  
  627. sub dbus_string {
  628.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_STRING,
  629.                       $_[0]);
  630. }
  631.  
  632. =item $typed_value = dbus_signature($value);
  633.  
  634. Mark a value as being a UTF-8 string, whose contents is a valid
  635. type signature
  636.  
  637. =cut
  638.  
  639.  
  640.  
  641. sub dbus_signature {
  642.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_SIGNATURE,
  643.                       $_[0]);
  644. }
  645.  
  646. =item $typed_value = dbus_object_path($value);
  647.  
  648. Mark a value as being a UTF-8 string, whose contents is a valid
  649. object path.
  650.  
  651. =cut
  652.  
  653. sub dbus_object_path {
  654.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_OBJECT_PATH,
  655.                       $_[0]);
  656. }
  657.  
  658. =item $typed_value = dbus_boolean($value);
  659.  
  660. Mark a value as being an boolean
  661.  
  662. =cut
  663.  
  664.  
  665.  
  666. sub dbus_boolean {
  667.     return Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_BOOLEAN,
  668.                       $_[0]);
  669. }
  670.  
  671. =item $typed_value = dbus_array($value);
  672.  
  673. Mark a value as being an array
  674.  
  675. =cut
  676.  
  677.  
  678. sub dbus_array {
  679.     return Net::DBus::Binding::Value->new([&Net::DBus::Binding::Message::TYPE_ARRAY],
  680.                       $_[0]);
  681. }
  682.  
  683. =item $typed_value = dbus_struct($value);
  684.  
  685. Mark a value as being a structure
  686.  
  687. =cut
  688.  
  689.  
  690. sub dbus_struct {
  691.     return Net::DBus::Binding::Value->new([&Net::DBus::Binding::Message::TYPE_STRUCT],
  692.                       $_[0]);
  693. }
  694.  
  695. =item $typed_value = dbus_dict($value);
  696.  
  697. Mark a value as being a dictionary
  698.  
  699. =cut
  700.  
  701. sub dbus_dict{
  702.     return Net::DBus::Binding::Value->new([&Net::DBus::Binding::Message::TYPE_DICT_ENTRY],
  703.                       $_[0]);
  704. }
  705.  
  706. =item $typed_value = dbus_variant($value);
  707.  
  708. Mark a value as being a variant
  709.  
  710. =cut
  711.  
  712. sub dbus_variant{
  713.     return Net::DBus::Binding::Value->new([&Net::DBus::Binding::Message::TYPE_VARIANT],
  714.                       $_[0]);
  715. }
  716.  
  717. =pod
  718.  
  719. =back
  720.  
  721. =head1 SEE ALSO
  722.  
  723. L<Net::DBus>, L<Net::DBus::RemoteService>, L<Net::DBus::Service>,
  724. L<Net::DBus::RemoteObject>, L<Net::DBus::Object>,
  725. L<Net::DBus::Exporter>, L<Net::DBus::Dumper>, L<Net::DBus::Reactor>,
  726. C<dbus-monitor(1)>, C<dbus-daemon-1(1)>, C<dbus-send(1)>, L<http://dbus.freedesktop.org>,
  727.  
  728. =head1 AUTHOR
  729.  
  730. Daniel Berrange <dan@berrange.com>
  731.  
  732. =head1 COPYRIGHT
  733.  
  734. Copyright 2004-2005 by Daniel Berrange
  735.  
  736. =cut
  737.  
  738. 1;
  739.