I have an array that looks like this:
and I have a subroutine that will print this in 2 columns but I'd like to put the array element next to each element so that i can print something like this:
1. laptop 3. computer
2. books 4. window
Thanks in advance for the help!
my @values = @_;
s/^\s*(.*?)\s*$/$1/s for (@values);
print $values[$_],("\t\t\t","\n")[$_ % 2] for 0..$#values;