On 9/13/07, John Abreau <[EMAIL PROTECTED]> wrote: >> s/^[\x20\t]*//; # trim leading space >> s/[\x20\t]*$//; # trim trailing space > > Any particular reason to use [\x20\t] instead of \s ?
\s would also eat newlines and similar. At a minimum, it would have to explicitly print with "\n" and use the -n switch instead of the -p switch. Which would be fine. But if the file contains non-native line endings, it can result in those getting mangled, or so I've found. I've got a lot of such files hanging around on my system. Just eating space and tab worked better for me. OTOH, \s should eat other kinds of in-line whitespace that might be encountered, including anything Unicode dishes up. So that might be better for some situations. YMMV. Or, since this is Perl we're talking about: TIMTOWTDI. ;-) -- Ben _______________________________________________ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/