Is there a single line in perl which does some magic like this.
Array = [100,200,300,400,500];
percent = 50%
new_Array = [50,100,150,200,250];
That is, I give an array and specify a percent. And it should give me a new array with the given percent of original array values.
should take care of odd numbers and give me either ceiling or floor of that value.
I know how to do it manually. Just wondering if perl has something surprising in store?
Thank you.