Is there one line in perl that does 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 indicate the percentage. And he should give me a new array with a given percentage of the original array values.
should take care of odd numbers and give me either the ceiling or the floor of this value.
I know how to do it manually. Just wondering if perl has something amazing in store?
Thank.
source
share