[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] interpolating



> Straightforward but inelegant:
> 
> s/<!--(\$[a-zA-Z_]\w*)-->/$$1/g;
> 
> This treats the value of $1 as a symbolic reference to another variable.

better to do:
    s/<!--\$([a-zA-Z_]\w*)-->/${$1}/g;

Unless you use strict, where you would have to use Ken William's suggestion:
   s/<!--(.*?)-->/$1/eeg;

-K


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org