From: <[EMAIL PROTECTED]>
> Hi Members,
> 1) The script below produce the following warnings:- "variable
> $betting_system will not stay shared at roulette.pl line 61."
> What is the problem and how do I rectify this problem.
Don't write a named subroutine within another named subroutine. It
doesn't work at all well.
In this case it's not needed, but if you need to share variables
between two subroutines you have to either do
{
my $variable;
sub first {...};
sub second {...};
}
or something like
sub first {
my $variable;
my $second = sub {
...
}
...
return $second;
}
my $specialised = first(some,params);
$specialised->(parameters);
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/