I have a text file like so:
dave ran very quickly
dan very slowly ran
I am doing a regex to look for the word “ran” but I also need to know where it starts (in the first case it is character 6, in the second case it’s 17).
I have (though it isn’t much):
for(@lines){
if(/ran/){
# find where ran is so we can continue parsing
}
}
It’s easy:
See the
perlvarman page for a detailed description of the@-array.