
richter at ecos
Apr 16, 2012, 5:36 AM
Post #4 of 5
(690 views)
Permalink
|
Hi, Embperl is cleaning up all global variables at the end of the page, so they don't persist and interfere with the next request. @tmp is cleaned up, before it gets written to %udat. If you use "my @tmp " instead it should work, or you can avoid cleaning up @tmp by putting it's name into %CLEANUP with value 0 (http://perl.apache.org/embperl/pod/doc/Embperl.-page-5-.htm#sect_28) Gerald > -----Original Message----- > From: Jean-Christophe Boggio [mailto:embperl [at] thefreecat] > Sent: Thursday, April 12, 2012 4:02 PM > To: embperl [at] perl > Subject: Problem with %udat and references > > Hello, > > I have this simple code : > > [.- > $req = shift; > @tmp=("1","a","zzz"); > $udat{verdict} = \@tmp; # <- this doesn't work > # $udat{verdict} = ["1","bla","x"]; # <- this works > -] > <script> > document.location="somewhere.html"; > </script> > > When I reach somewhere.html, $udat{verdict} is populated only when the > second line is active (the one explicitly defining the arrayref as > ["1","bla","x"]). > When I try with a reference to @tmp it is just a reference to an empty array. > > What am I missing ? Anyone else experimenting such behaviour ? > > -- > Jean-Christophe Boggio -o) > embperl [at] thefreecat /\\ > Independant Consultant and Developer _\_V > > --------------------------------------------------------------------- > To unsubscribe, e-mail: embperl-unsubscribe [at] perl > For additional commands, e-mail: embperl-help [at] perl --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-unsubscribe [at] perl For additional commands, e-mail: embperl-help [at] perl
|