HTML::Mason::Commands - Old Mason command reference
This was the documentation for the mc_ command set. In Mason 0.8 and beyond, mc_ commands have been replaced by the new HTML::Mason::Request API. e.g.
mc_
mc_comp becomes $m->comp mc_file becomes $m->file etc.
Below is a description of how to convert your mc_ commands to $m methods. There is also a utility provided with the distribution, bin/convert0.8.pl, that performs these conversions for you. For backwards compatibility mc_ commands still work for a limited time but will eventually go away.
$m
mc_abort becomes $m->abort
mc_abort
$m->abort
mc_auto_comp becomes $m->fetch_next->path
mc_auto_comp
$m->fetch_next->path
mc_auto_next becomes $m->call_next
mc_auto_next
$m->call_next
mc_cache becomes $m->cache
mc_cache
$m->cache
mc_cache_self becomes $m->cache_self
mc_cache_self
$m->cache_self
mc_caller becomes $m->callers(1)->path
mc_caller
$m->callers(1)->path
mc_call_self becomes $m->call_self
mc_call_self
$m->call_self
mc_comp becomes $m->comp
mc_comp
$m->comp
mc_comp_exists becomes $m->comp_exists
mc_comp_exists
$m->comp_exists
mc_comp_source() becomes $m->current_comp->source_file
mc_comp_source()
$m->current_comp->source_file
mc_comp_source(path) becomes $m->fetch_comp(path)->source_file. This no longer works with nonexistent components as it used to.
mc_comp_source(path)
$m->fetch_comp(path)->source_file
mc_comp_stack becomes map($_->title,$m->callers)
mc_comp_stack
map($_->title,$m->callers)
mc_date goes away, this was a legacy function. Replace by calling the date formatting function of your choice on $m->time.
mc_date
$m->time
mc_dhandler_arg becomes $m->dhandler_arg
mc_dhandler_arg
$m->dhandler_arg
mc_file becomes $m->file
mc_file
$m->file
mc_file_root becomes $m->file_root
mc_file_root
$m->file_root
mc_out becomes $m->out
mc_out
$m->out
mc_time becomes $m->time
mc_time
mc_suppress_http_header (with or without argument) no longer has any effect and can simply be removed. See Devel/Sending HTTP Headers for more information.
mc_suppress_http_header
Jonathan Swartz, swartz@transbay.net
HTML::Mason, HTML::Mason::Devel
To install HTML::Mason, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Mason
CPAN shell
perl -MCPAN -e shell install HTML::Mason
For more information on module installation, please visit the detailed CPAN module installation guide.