I store some value with an array reference like :
$self->{stash}->{css_files} = ['a.css', 'b.css'];
I append another css file after with push function, so the array expand more and more.
So I must be avoid to using array reference in config variables.
I don't understand. Didn't you want the array to expand? If you were trying to replace it, just set it directly instead of using push:
$t->{stash}->{css_files} = ['a.js', 'b.js'];
There are several other things in this code that I would suggest changing, but this forum isn't the best place to do a code review. If you'd like more advice on your code, please post it on the mod_perl mailing list, or on http://perlmonks.org/ [perlmonks.org].
I make mistake.
Direct assign value works good.
I never think it before.I always use push.
For more advice, I post it on http://perlmonks.org/?node_id=602639 [perlmonks.org]
thx.
Regards.
what's the trouble? (Score:1)
Re: (Score:1)
These three script show what happens.
-------configuration file(MyConfigTest.pm)--
-------startup file(mystartup.pl)-------
use Perl qw(others us);
Re: (Score:1)
I don't understand. Didn't you want the array to expand? If you were trying to replace it, just set it directly instead of using push:
$t->{stash}->{css_files} = ['a.js', 'b.js'];There are several other things in this code that I would suggest changing, but this forum isn't the best place to do a code review. If you'd like more advice on your code, please post it on the mod_perl mailing list, or on http://perlmonks.org/ [perlmonks.org].
Re: (Score:1)
Direct assign value works good.
I never think it before.I always use push.
For more advice, I post it on
http://perlmonks.org/?node_id=602639 [perlmonks.org]
thx.
Regards.
use Perl qw(others us);