tel2 has asked for the wisdom of the Perl Monks concerning the following question:
Is there a concise way of writing this?:
$sth->execute($role[$row][1], $role[$row][2], $role[$row][3], $role[$row][4], $role[$row][5], $role[$row][6], $role[$row][7], $role[$row][8], $role[$row][9], $role[$row][10]);
I tried this:
$sth->execute($role[$row][1..10];
but that doesn't seem to work. I assume that's because the latter is a slice?
Thanks.
tel2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Concise code to list array elements
by Gangabass (Vicar) on Apr 08, 2013 at 03:18 UTC | |
by tel2 (Pilgrim) on Apr 08, 2013 at 04:16 UTC | |
|
Re: Concise code to list array elements
by Loops (Curate) on Apr 08, 2013 at 03:48 UTC | |
by tel2 (Pilgrim) on Apr 08, 2013 at 04:18 UTC | |
by davido (Cardinal) on Apr 08, 2013 at 04:54 UTC | |
by tel2 (Pilgrim) on Apr 08, 2013 at 05:13 UTC |