Hi,
I have never used Mason before so I have really basic questions. I need help
and would really appreciate any. I want to create a website using Mason 1.42
on windows server 2003. I am not using the Apache Mod-perl configuration.
The website would be using IIS. So i guess this is whats called "using mason
from standalone script" . Am I correct? I would be really grateful if
someone can walk me through the whole installation process and how to check
if mason is working correctly?
Also, I have an handler file : handler.pl. It has a workaround code for
windows server 2003 and Mason 1.25, will i have to use it? I am using mason
1.42. I would like to know what is the PATH_TRANSLATED variable in the
handler.pl file ? And what path should it contain and how do I modify it?
Here is the handler.pl file code:
#!/usr/bin/perl
#
# This is a basic, fairly fuctional Mason handler.pl.
#
# For something a little more involved, check out session_handler.pl
package HTML::Mason;
# Bring in main Mason package.
use HTML::Mason;
# Bring in ApacheHandler, necessary for mod_perl integration.
# Uncomment the second line (and comment the first) to use
# Apache::Request instead of CGI.pm to parse arguments.
# use HTML::Mason::ApacheHandler;
# use HTML::Mason::ApacheHandler (args_method=>'mod_perl');
# Uncomment the next line if you plan to use the Mason previewer.
#use HTML::Mason::Preview;
use strict;
# List of modules that you want to use from components (see Admin
# manual for details)
#{ package HTML::Mason::Commands;
# use CGI;
#}
# Create Mason objects
#
my $parser = new HTML::Mason::Parser;
my $interp = new HTML::Mason::Interp (parser=>$parser,
comp_root=>'c:/atm',
data_dir=>'c:/atm-data');
use CGI;
my $q = new CGI;
my (%args);
foreach my $key ( $q->param ) {
foreach my $value ( $q->param($key) ) {
if (exists($args{$key})) {
if (ref($args{$key})) {
$args{ $key} = [...@{$args{$key}}, $value];
} else {
$args{$key} = [$args{$key}, $value];
}
} else {
$args{$key} = $value;
}
}
}
my $comp = $ENV{'PATH_TRANSLATED'};
$comp =~ s/\\/\//g; # Replace '\' with '/'
my $root = $interp->comp_root;
$comp =~ s/^$root// or die "Component outside comp_root $root"; # Remove
root path from $comp
#Workaround for Windows Server 2003 and Mason 1.25 (3/1/06)
# The previous four lines of code above didn't work for me because of
backslash forward slash handling differences with my software versions. I
did the following workaround
#my $comp = $ENV{'PATH_TRANSLATED'};
#my $root = $interp->comp_root;
#$comp =~ s/^\Q$root//; # $comp has backslashes even though it was set with
forward slashes in the new Interp object. Root has backslashes also, and
they need to be escaped with the \Q function.
#$comp =~ s|\\|/|g; # Change backslashes to forward slashes for the upcoming
exec call.
#End of workaround
print("Content-type: text/html\n\n");
$interp->exec($comp, %args);
Looking forward to a reply. Its urgent.
Thanks,
Charmie
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users