SPUG: getting error message while substitution

Yitzchak Scott-Thoennes sthoenna at efn.org
Sun Apr 2 18:53:13 PDT 2006


On Mon, Apr 03, 2006 at 08:07:49AM +0550, Sachin Chaturvedi wrote:
>  i am having a file in which i have statement
> 
> $ret_val = system("perl $ENV{SOURCE_ROOT}/scripts/Test_script.pl");

Gah.  I hope you are in a situation where no one can do:

SYSTEM_ROOT="-e0; rm -rf /; echo "

If not, save $ENV{SOURCE_ROOT} into a variable and check it for
reasonableness.

> and i want to make a substitution in which i want to remove occurence of perl from this line. i tried this by using 
> file handle for that file and doing following substitution
> 
> $line =~ s|\perl \$ENV{SOURCE_ROOT}/scripts/Test_script.pl|\$ENV{SOURC
> _ROOT}/scripts/Test_script|si;
> 
> but i am getting following error message
> 
> Can't find unicode character property definition via main->e or e.pl a unicode/Is/e.pl line 41
> 
> i dont know why this is coming . how can this be removed so that my substituton is done correctly 

That comes from the "\pe".
See http://perldoc.perl.org/perlre.html#Regular-Expressions:

  \pP	Match P, named property.  Use \p{Prop} for longer names.

The general rule is that \ followed by an alphanumeric character may
mean something weird, but \ followed by any other character matches
that character.  So get rid of the \ before "perl" and add one before
the . in .pl.


More information about the spug-list mailing list