leading spaces and Perl.

Stewart C.Russell scruss-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org
Fri Oct 24 18:10:39 UTC 2003


Sergey Kuznetsov wrote:
> 
> $Uname =~ s/(?:^\s+|\s+$)//g;

I suspect that the classic two-liner of:

s/^\s+//;
s/\s+$//;

would be at least as quick, easier to understand, and less error-prone.

 Stewart


--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list