Hello guys/gals,
i am sorry as this is probably very simply but i am slowly learning
perl and need to convert some old korn shell scripts.
I need to be able to search a file line by line but only match a string at particular location on that line, for example character 20-30. So my file could look something like this:
Code:
apple orange apple
apple potato apple
tomato flower orange
i want to be able to search this file for string "orange" but i only want to search for this string at particular position, say from character 7-13. I am used to in bash i can use |awk '{print $2)' to get my second field ..but how would i do it in
perl using regular expressions ?
Thanks a bunch