On Mon, Mar 28, 2011 at 11:10, Katya Gorodinsky
wrote:
> Maybe this way:
>
> @bet1 = (0,0,0,0);
> @bet2 = (0,0,0,1);
> @bet3 = (0,0,1,0);
>
> $random_bet_position = int(rand(3) + 1);
>
> $name = 'bet' . $random_bet_position;
> @selected_bet = @{$name};
Symbolic references are incredibly danger
On Mon, Mar 28, 2011 at 12:10 PM, Katya Gorodinsky <
katya.gorodin...@ecitele.com> wrote:
> $random_bet_position = int(rand(3) + 1);
>
> $name = 'bet' . $random_bet_position;
> @selected_bet = @{$name};
>
> No no no.
Gosh no.
Don't do that.
http://perl.plover.com/varvarname.html
Brian.
2011/3/28 jj mahoney :
>
> Hi, How do I name this variable correctly, @{bet$random_bet_position);
> With regards to the script below, @selected_bet is suppose to select either
> @bet1, @bet2 or @bet3 depending on the chosen number held by
> $random_bet_position, so how do I do this? Thanks
>
> @b
Maybe this way:
@bet1 = (0,0,0,0);
@bet2 = (0,0,0,1);
@bet3 = (0,0,1,0);
$random_bet_position = int(rand(3) + 1);
$name = 'bet' . $random_bet_position;
@selected_bet = @{$name};
-Original Message-
From: jj mahoney [mailto:itshardtoget...@hotmail.com]
Sent: Monday, March 28, 2011 4
2011/3/28 jj mahoney
>
> Hi, How do I name this variable correctly, @{bet$random_bet_position);
> With regards to the script below, @selected_bet is suppose to select either
> @bet1, @bet2 or @bet3 depending on the chosen number held by
> $random_bet_position, so how do I do this? Thanks
>
> @bet