magicmarkuk 0 Light Poster

Hi

I am new to all of this so please forgive me if my question is either really obvious or indeed in the wrong forum.

I have had a script written for me that displays details of books e..t. title, author etc.

The string which holds the author seems to always have a space at the beginning of it. How can I remove the space (or indeed whatever other invisible character it is)?

The string value is $auth and the relevant part of the code (I think) is as follows:

if ($productauthor =~ /\|\|/i) {
@auth = split(/\|\|/, $productauthor);
foreach $auth (@auth) {
$auth =~ s/^\s+//g;
$auth =~ s/\s+$//g;

$authorurl .= "\&nbsp\;<a href=\"search.cgi?key=$auth&author=1\">$auth</a>\&nbsp\;";
}
}else {
$authorurl = "<a href=\"search.cgi?key=$productauthor&author=1\">$productauthor</a>";
}

If anyone can help me I would be most grateful.

Thanking you in anticipation.

Regards

Mark