in reply to need to put values (from unpack) into array-ref
Yuck! Using unpack is inappropriate here! Use substr:
Alternatively:push(@{$a[$_%2]}, substr($b, $_, 1)) for 0..13;
And now for something fun (but not recommended):push(@{$a[0]}, $b =~ /(.)./g); push(@{$a[1]}, $b =~ /.(.)/g);
my $t = 1; push(@{$a[$t ^= 1]}, $_) foreach $b =~ /(.)/g;
By the way, you shouldn't name your variables $b (or $a). These are reserved for sort.
|
|---|