[SR-Users] Memory leak

Iñaki Baz Castillo ibc at aliax.net
Wed Sep 22 22:25:45 CEST 2010


2010/9/22 marius zbihlei <marius.zbihlei at 1and1.ro>:
> this will be much better handled by a transformation
>
> if ( $(fn{s.len}) > 62 ) {...}

Yes, using pcre_math is good when we need to perform a regular
expression against a PV (which is not possible using "=~"). For
example I use it to check if the RURI username matches a prefix
extracted from a database:

  if ! pcre_match("$rU", "^$var(client_prefix_in)") {

This works because the regular expression is compiled in runtime.


This would not be possible with "=~":

  if  !  $rU =~ "^$var(client_prefix_in)") {

It fails because the regular expression is compiled when parsing the
config script.


-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-users mailing list