On 6/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] a écrit :
> >> Don't forget you can use $m->notes(...) to store variables and objects
> >> for each request instance.
> >
> > That's great !
>
> Argh, talked too fast :-(
>
> Now I have another very strange behaviour : depending
> on ???? I get different results :
>
> With the following code, $m->notes('PUBLIC_MAILROOT') is
> empty and the directory is not created :
>
> if (! $codemail) {
> mkdir($m->notes('PUBLIC_MAILROOT')."/$idmail");
> }
>
> With this code, it *sometimes* works as expected :
>
> push (@out,$m->notes('PUBLIC_MAILROOT'));
> if (! $codemail) {
> mkdir($m->notes('PUBLIC_MAILROOT')."/$idmail");
> }
>
>
> I declare my constant in the only autohandler :
>
> <%once>
> use DBI;
> use DBD::Pg;
> my $dbh;
> $m->notes('PUBLIC_MAILROOT' => '/var/www/sites/semi/dlm');
> </%once>
>
>
> Is it normal that if I mispell PUBLIC_MAILROOT I don't get an error ?
> (I'm with the default strict pragma).
>
> Why is this $m->notes() sometimes filled and sometimes not ?
>
>
> I'm going crazy...
>
You are not supposed to use $m or $r in this section, check the below
manual page:
http://www.masonhq.com/docs/manual/Devel.html#__once_
++++++++++++++++++++++++++
This section is useful for declaring persistent component-scoped
lexical variables (especially objects that are expensive to create),
declaring subroutines (both named and anonymous), and initializing
state.
This code does not run inside a request context. You cannot call
components or access $m or $r from this section..........
++++++++++++++++++++++++++
XC
> --
> Jean-Christophe Boggio
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users