in reply to Can't use string
use strict; my @rows; $rows[1] = 10; my $val = 1; my $row = $rows[$val]; print("$row\n");
If you're indexes are sparsed or strings, a hash would be more appropriate.
use strict; my %rows; $rows{1} = 10; my $val = 1; my $row = $rows{$val}; print("$row\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't use string
by plobsing (Friar) on Jan 31, 2008 at 23:14 UTC | |
by ikegami (Patriarch) on Feb 01, 2008 at 04:19 UTC | |
by plobsing (Friar) on Feb 01, 2008 at 05:34 UTC | |
by ikegami (Patriarch) on Feb 01, 2008 at 06:08 UTC |