Thanks to your comments I have figured out what I was doing wrong. If
I declared the variable like $MY::$min_bytes all works correctly.
Thank you everyone for your assistance.
PS... That was one funny example you give at the end.... Made me
On Fri, 2005-02-04 at 10:19 +0100, Joe wrote:
> On Thu, 3 Feb 2005, Bob Koertge wrote:
> > I have just tried this and it does not work. The test is just skipped.
> > <test>
> > <code name="min_bytes">return $min_bytes</code>
> > <param name="max_bytes">99000</param>
> Apparently the scalar value $min_bytes is not initialized at this point.
> I did a trivial test which appears to work (but is not likely what you
> <code name="min_bytes">$bytes = 2800; return $bytes</code>
> So, it looks like you need to set $min_bytes somewhere in a persistent
> way. I don't know how to achieve this (a quick test with wt script
> didn't work out for me either).
> However, a possible solution would be to dynamically derive a value for
> the minimum content size within your code section. A rather useless
> example would be
> <code name="min_bytes">return 1 + (time() % 3600)</code>
> This actually checks if the content size in bytes is larger than the
> number of seconds into the current hour (pretty useless, isn't it???).