http://qs1969.pair.com?node_id=323992

rkg has asked for the wisdom of the Perl Monks concerning the following question:

Hi.

Mason scoping question. Here's a reduction that illustrates the issue:

Why does this work properly (that is, the error message is sent off to the component)

<html> <body> % eval { die "this is an error"; }; % if ($@) { % my $message = $@; % $m->comp('/comps/error.comp', message=> $message); % } </body> </html>
But this does not work properly (a blank string is sent off the component)
<html> <body> % eval { die "this is an error"; }; % if ($@) { % $m->comp('/comps/error.comp', message=> $@); % } </body> </html>
Thanks for any insight.

rkg

UPDATE

Ok, since (notice the quotes)

$m->comp('/comps/error.comp', message=> "$@");
does work properly, I'm wondering if the issue is Mason, or if $@ has magic properties...

is $@ a simple scalar, or something more?