If I declared a variable $myString with the value \'3 \' (notice the white space). Is there any function to remove the white space for the return v
$myString
\'3 \'
Another potential alternative solution is Text::Trim from CPAN, which will "remove leading and/or trailing whitespace from strings". It has a trim function which may suit your needs.
trim