> "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
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'
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/
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
> "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>
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=