Reputation: 2675
I am trying to turn a number in a text file I find with regex into a list of numbers starting with zero.
for example, the number is 4
I need to make an array that comprises of 0,1,2,3
.
How can this be done?
Upvotes: 3
Views: 115
Reputation: 455460
You can use the range operator as:
@arr = 0..$number_read_from_file - 1;
Upvotes: 9