print Dumper($result); $VAR1 = [ " echo ", " ----------", ...
$result is a reference to an array of strings. You can access the actual array via @$result (perlreftut, perlref). You can simply use this to remove the leading whitespace from all the elements of $result: s/^\s+// for @$result;
Update: Also, your sub remove_leadspace is designed to return a modified list of strings, but you're not doing anything with its return value. You could do: @$result = remove_leadspace(@$result); or my @trimmed = remove_leadspace(@$result);
In reply to Re: Problems removing leading whitespace
by haukex
in thread Problems removing leading whitespace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |