Re: RFC: utils.pm
From: Joe Smith (Joe.Smith_at_inwap.com)
Date: 02/12/04
- Next message: Tompyna: "When i try to implement a server program giving UDP as protocol , it works fine , but if the same code is executed with TCP as protocol option, it gives an error."
- Previous message: Uri Guttman: "Re: RFC: utils.pm"
- In reply to: Ben Morrow: "Re: RFC: utils.pm"
- Next in thread: Peter Hickman: "Re: RFC: utils.pm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 12 Feb 2004 07:51:06 GMT
Ben Morrow wrote:
> Tore Aursand <tore@aursand.no> wrote:
>> trim( $value ) - Combines ltrim() and rtrim().
>
> $value =~ s/^\s*(.*?)\s*$/$1/;
> or some such.
I've always heard that two anchored single-wildcard searchs are
faster than a single regex with three wildcards.
$value =~ s/^\s+//; $value =~ s/\s+$//;
-Joe
- Next message: Tompyna: "When i try to implement a server program giving UDP as protocol , it works fine , but if the same code is executed with TCP as protocol option, it gives an error."
- Previous message: Uri Guttman: "Re: RFC: utils.pm"
- In reply to: Ben Morrow: "Re: RFC: utils.pm"
- Next in thread: Peter Hickman: "Re: RFC: utils.pm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]