Re: cache and the interpreter

2011-05-06 Thread Uri Guttman
> "MM" == Mike McClain writes: >> INIT { MM> This is the solution I needed. MM> Absolutely a big help. MM> Not only did you supply an explanation but a solution. MM> Best answer possible. not to rain on your parade but from your point of view INIT and BEGIN are the same thing. th

Re: cache and the interpreter

2011-05-06 Thread Mike McClain
On Fri, May 06, 2011 at 08:16:14AM +0100, Rob Dixon wrote: > On 06/05/2011 01:21, Mike McClain wrote: > > > > Here's a simple example that illustrates the problem I've run into: > As Uri says, initialising variables at the point of declaration is done > at run time. This is from 'Programming Perl'

Re: cache and the interpreter

2011-05-06 Thread Dr.Ruud
On 2011-05-06 02:21, Mike McClain wrote: $fibs[$#fibs+1] = 2; push @fibs, 2; -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: cache and the interpreter

2011-05-06 Thread Rob Dixon
On 06/05/2011 01:21, Mike McClain wrote: > > Here's a simple example that illustrates the problem I've run into: > > perl -le' > show(); > { my @fibs = (0,1,1); my ($x, $y) = (1,2); > sub show > { print "x=$x\ty=$y\t\$#fibs=$#fibs\tfibs=@fibs\tscalar \@fibs = ", > scalar

Re: cache and the interpreter

2011-05-05 Thread Uri Guttman
> "MM" == Mike McClain writes: MM> Here's a simple example that illustrates the problem I've run into: MM> perl -le' MM> show(); MM> { my @fibs = (0,1,1); my ($x, $y) = (1,2); MM> sub show MM> { print "x=$x\ty=$y\t\$#fibs=$#fibs\tfibs=@fibs\tscalar \@fibs = ", MM>

cache and the interpreter

2011-05-05 Thread Mike McClain
Here's a simple example that illustrates the problem I've run into: perl -le' show(); { my @fibs = (0,1,1); my ($x, $y) = (1,2); sub show { print "x=$x\ty=$y\t\$#fibs=$#fibs\tfibs=@fibs\tscalar \@fibs = ", scalar @fibs; }; $fibs[$#fibs+1] = 2; } show(); ' x= y=