Hi,
The following regex removes white space from head and tail of the line.
perl -pe 's/^\s+|\s+$//g'
How come it removes both ? It should just remove front because of presence of or (|).
Looking it in boolean context, remove space from front or remove space from end.
The first substitution...