I have a script whci works if I hard code data but if I want to change these I would like to replace this with variables.

Can someone help please?
<code>#!/usr/bin/perl -w

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;
use SOAP::Lite;
use CGI::Carp qw/fatalsToBrowser/;
## - christ this works! attempt to add data to string below
## sort field 0 isbn 1 title field value is the search string which is alphnumeric
##use strict;
use warnings;
my $thestring="cats";
my $thevar ="1";
$getsearch->value($thestring); # set new value
$getmyvar->value($thevar);
my $searchstring = $getsearch->value; # store it in variable
my $sortfield = $getmyvar->value; # store it in variable
# my $sortfield = SOAP:ata->type('string')->name('sortField')->value(1);
print "Content-Type: text/xml; charset=utf-8";
##my $searchstring = SOAP:ata->type('string')->name('fieldValue')->value(cats);


my $message = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlnssd=\"http://babel.webservices.book.nielsen.com/xsd\">
<soapenv:Header/>
<soapenv:Body>
<xsd:getSearchService>
<xsdaram0>
<xsd:clientId>BookmarcusBDWS01</xsd:clientId>
<!--Optional:-->
<xsd:currency>GBP</xsd:currency>
<xsd:format>7</xsd:format>
<xsd:from>0</xsd:from>
<xsd:indexType>3</xsd:indexType>
<!--Optional:-->
<xsd:marketSegment>UK</xsd:marketSegment>
<!--1 or more repetitions:-->
<xsdarams>
<!--Optional:-->
<xsd:fieldLogic>
<xsd:fieldLogic>0</xsd:fieldLogic>
</xsd:fieldLogic>
<xsd:fieldSearch>0</xsd:fieldSearch>";
$message = $message.$searchstring;
$message = $message."</xsdarams>
<xsdassword>mc709cpq264i</xsdassword>
<xsd:requestId>TestSearch</xsd:requestId>
<xsd:resultView>2</xsd:resultView>
<!--1 or more repetitions:-->
<xsd:sortField>";
$message = $message.$sortfield;
$message = $message." <xsd:sortOrder>1</xsd:sortOrder>
</xsd:sortField>
<!--Optional:-->
<xsd:territory>UK</xsd:territory>
<xsd:to>4</xsd:to>
</xsdaram0>
</xsd:getSearchService>
</soapenv:Body>
</soapenv:Envelope>";

my $userAgent = LWP::UserAgent->new();
my $request = HTTP::Request->new(POST => 'http://wsqa.nielsenbookdataonline.com/webservices/services/BDOLWebService?wsdl');
$request->header(SOAPAction => '"http://babel.webservices.book.nielsen.com/xsd"');
$request->content($message);
$request->content_type("text/xml; charset=utf-8");
my $response = $userAgent->request($request);

if($response->code == 200) {
print $response->as_string;
}
else {
print $response->error_as_HTML;
}</code>

Any help is appreciated