How do you create a Perl Program that asks a user to enter two numbers and assign those numbers to selections in a text and then reverse the text? I think I am supposed to use splice array and the reverse function but it is not coming out properly.
print "Enter a number:\n";
chomp ($number=<>);
print "Enter another number:\n";
chomp ($number=<>);
@array=(Yellow Green Brown Pink Black);
splice@array (0..4);
reverse@array:
print"The corresponding number and color)
I am supposed to do an inversion by asking the user to enter a two numbers and then invert the words in between them. i.e. If I choose 1 and then 4 I should get Pink, Brown, Green, Yellow.