Is there a built-in function to trim leading and trailing whitespace such that trim(\" hello world \") eq \"hello world\"?
trim(\" hello world \") eq \"hello world\"
According to this perlmonk's thread:
$string =~ s/^\s+|\s+$//g;