Last week I had trouble creating a handler for Mason on IIS. The code from the WIKI how-to didn't work for me, probably because I'm using different versions (newer) of software from when the how-to was written. My problem was one of backslash escaping and I solved it with the following handler code snippet. This might help someone else.

my $interp = HTML::Mason::Interp->new (comp_root => 'C:/virtualServers/mason', data_dir=>'C:/virtualServers/mason/data');

my $comp = $ENV{'PATH_TRANSLATED'};
my $root = $interp->comp_root;

# In the following statement $root is C:\virtualServers\mason even though I used forward slashes when setting it above $comp =~ s/^\Q$root//; # Here I have to escape the backslashes in $root with the \Q function

$comp =~ s|\\|/|g; # Here I change the backslashes to forward slashes ... exec below doesn't work for me with backslashes.

$interp->exec($comp, %args);

Mike



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to