in reply to Assigning value to the array elements
You can assign into elements of an array if they are variables.
All work is in one line -- within the print statement.
use List::MoreUtils qw(pairwise); my ($first, $second, $third, $fourth, $fifth, $sixth); my @vars = \($first, $second, $third, $fourth, $fifth, $sixth); my @aarr = ('<chap', '<book', '<isb'); print {$,=' '; \*STDOUT} pairwise { ${$a} = $b} @vars, @aarr;
In Section
Seekers of Perl Wisdom