Net::Plesk::Method - Perl base class for Plesk XML Remote API Method


Net-Plesk documentation Contained in the Net-Plesk distribution.

Index


Code Index:

NAME

Top

Net::Plesk::Method - Perl base class for Plesk XML Remote API Method

SYNOPSIS

Top

  @ISA = qw( Net::Plesk::Method );

DESCRIPTION

Top

This module implements a base class for constructing requests using SWSOFT's Plesk.

METHODS

Top

new

Creates a new Net::Plesk::Method object and initializes it. =cut

encode

Returns the xml encoded entity

BUGS

Top

  Creepy crawlies.

SEE ALSO

Top

SWSOFT Plesk Remote API documentation (1.4.0.0 or later)

AUTHOR

Top

Jeff Finucane <jeff@cmh.net>

COPYRIGHT AND LICENSE

Top


Net-Plesk documentation Contained in the Net-Plesk distribution.
package Net::Plesk::Method;

use strict;

use vars qw( $VERSION @ISA $AUTOLOAD $DEBUG );

$VERSION = '0.01';

$DEBUG = 0;

my %char_entities = (
  '&' => '&amp;',
  '<' => '&lt;',
  '>' => '&gt;',
);

sub new {
  my $proto = shift;
  my $class = ref($proto) || $proto;
  my $me;
  my $self = \$me;
  bless($self, $class);
  $self->init(@_);
  return $self;
}


sub encode {
  my ($self,$value) = (shift,shift);
  $value =~ s/([&<>])/$char_entities{$1}/ge;
  return $value;
}

1;