Hi All.
just some thoughts:
In my current work, I see a lot of:
if ($str =~ s/something (something)//) {
code
}
which is quite nice. if the pattern is found, the substitute happens and
you get captures on $1 and friends.
Also, I see a lot of using the 'e' switch in substitutes. something like:
$str =~ s/<translate "(.*?)">/translate($1)/ge;
and the translate tags are processed using the translate function.
just note that the regex engine was not very reentrant safe in old
versions of Perl, so be careful when using regex inside the executed
code. Only in the latest version it is officially safe to do it.
Also, editors are not aware that the right hand of the regex is not
code, and need to be colored as code.
so the result is an ugly string-like coloring for the chunk of code.
I also learned that a modern web site is quite a monster, and as every
page or AJAX call need an entry point of its own, the site code have
tens if not hundreds of entry points. if you are lucky you can reuse
some of the entry points between different locations.
Oh well.
Shmuel.
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl