home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / perl5 / auto / RPC / XML / Procedure / clone.al < prev    next >
Encoding:
Text File  |  2008-11-04  |  1.2 KB  |  40 lines

  1. # NOTE: Derived from blib/lib/RPC/XML/Procedure.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package RPC::XML::Procedure;
  5.  
  6. #line 605 "blib/lib/RPC/XML/Procedure.pm (autosplit into blib/lib/auto/RPC/XML/Procedure/clone.al)"
  7. ###############################################################################
  8. #
  9. #   Sub Name:       clone
  10. #
  11. #   Description:    Create a near-exact copy of the invoking object, save that
  12. #                   the listref in the "signature" key is a copy, not a ref
  13. #                   to the same list.
  14. #
  15. #   Arguments:      NAME      IN/OUT  TYPE      DESCRIPTION
  16. #                   $self     in      ref       Object of this class
  17. #
  18. #   Returns:        Success:    $new_self
  19. #                   Failure:    error message
  20. #
  21. ###############################################################################
  22. sub clone
  23. {
  24.     my $self = shift;
  25.  
  26.     my $new_self = {};
  27.     for (keys %$self)
  28.     {
  29.         next if $_ eq 'signature';
  30.         $new_self->{$_} = $self->{$_};
  31.     }
  32.     $new_self->{signature} = [];
  33.     @{$new_self->{signature}} = @{$self->{signature}};
  34.  
  35.     bless $new_self, ref($self);
  36. }
  37.  
  38. # end of RPC::XML::Procedure::clone
  39. 1;
  40.