On 12.7.2009, at 2.44, MK wrote:
> added to ZooDemo.pm:
> sub js_esc {
> my $ref = shift;
> $$ref =~ s/'/\\'/;
> }
This breaks if the string contains the sequence \'
Also, you aren't doing a global substitution. Only the first
apostrophe will be escaped. This should be safer:
$$ref =~ s/\\/\\\\/g;
$$ref =~ s/'/\\'/g;
$$ref = "'" . $$ref . "'";
> then in the appropriate page:
> $m->interp->set_escape("j"=>\&js_esc);
Consider using an autohandler for this. Less code duplication.
> parameters: { name: 'heap\'s moose',
This isn't incorrect, but strictly speaking you do not need that '
there. I assume you rewrote the "h" escaper?
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users