#!/usr/bin/perl -p

# Program to trim leading and trailing whitespace from lines in a text stream.
#
# This program has NO WARANTY.  USE IT STRICTLY AT YOUR OWN RISK.
#
# I specify space and tab explictly, rather than \s, because \s sometimes
# eats newlines in my (very brief) testing, resulting in missing blank lines
# and/or the entire file on one very very very long line.
#
# "\x20" = hex 20 = decimal 32 = ASCII space.  A literal space tends to get
# eaten by well-meaning but ignorant reformatting tools.
#
# Need /g flag for case of both leading AND trailing space.
#
# BUG: Documentation is longer than the code.  :-)

s/^[\x20\t]*|[\x20\t]*$//g;

# END OF FILE

