I have a requirement to remove the leading and trailing spaces in each column of a string delimited by "|"
TEST| 100| 0.00 |TEST STRING I am using the following regular expressions to remove the spaces, but it does not seem to work.
$data = "TEST| 100| 0.00 |TEST STRING ";
$data =~ s/(^|\|)\s+/\1/g;
$data =~ s/\s+$//;
Any help would be appreciated.