leading spaces and Perl.
Lance F. Squire
lance-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Fri Oct 24 17:53:16 UTC 2003
Fraser Campbell wrote:
> On Friday 24 October 2003 13:42, Lance F. Squire wrote:
>
>
>>I've recently found that users can enter data with leading spaces. I'm
>>attempting to kill this without losing the between word spaces.
>>
>>s/\s+//; removes all spaces.
>>s/^\s//; and s/^\s//; don't seem to work.
>>
>>Am I missing something?
>
>
> A + in the second expression ...
>
> my $x = ' adsf asdf asdf adsf asdf';
> $x =~ s/^\s+//;
>
Sorry,
>>s/^\s//; and s/^\s//; don't seem to work.
should have read:
>>s/^\s+//; and s/^\s//; don't seem to work.
--
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