Buddyholly83
IS-IT--Management
I have created an instance of SendServiceTest in my Main perl app and then call a method of SendServiceTest on the object like so:
I then want this method to use the 3 fields of the object plus additional values for calling another method(FormPostTest) in FormPostClass. How do i supply these object values? Below is my SendServiceTest class that creates the FormPostClass object and calls the FormPostTest method (the method i want to pass object values to):
Code:
my $message = new SendServiceTest
(
$username,
$password,
$account
);
$message -> sendMessageTest($uri, $recipient, $originator, $body, $type, $validityPeriod);
I then want this method to use the 3 fields of the object plus additional values for calling another method(FormPostTest) in FormPostClass. How do i supply these object values? Below is my SendServiceTest class that creates the FormPostClass object and calls the FormPostTest method (the method i want to pass object values to):
Code:
package SendServiceTest;
use FormPostClass;
use strict;
# Class constructor
sub new
{
my ($class, $username, $password, $account) = @_;
my $self =
{
username => $username,
password => $password,
account => $account
};
bless ($self, $class);
return $self;
}
# Send the text message
sub sendMessageTest
{
my ($object, $uri, $recipient, $originator, $body, $type, $validityPeriod) = @_;
my $post = new FormPostClass();
$post -> formPostTest($object->{username}, $object->{password}, $object->{account},
$uri, $recipient, $originator, $body, $type, $validityPeriod);
}