I got an answer to my question here: How do I know if a file is tab or space delimited in Perl?
but it would really help me if someone could break down the regex and explain what is going on and why it wont work on the last line of the file.
~/^(\d+\s+)+?$/
I thought the above had ‘+’ in theback so if i add ‘*’ it will work because * means zero or more…but that did not work
It should match a string of an entire line of space or tab separated numbers. I’m not exactly sure about why it’d be failing on the last line.. perhaps there’s no space character at the end? Since each number must be followed by at least one space, that might be it.