I have been trying to scan a file and perform an 'if' using a multi-line m
option, but unfortunately i am unable to get the result I want.
Here is the code I have written
# Open map files (map_merc and rom.dld)
open(MAP, "<map_merc") || die "Unable to open map_merc";
# Read map_merc :
if( ($titi, $toto) = /^\.(\w+).*$\t+\.\w+\W+(\w+).*$/m)
print($titi, $toto, "\n");
What I want to do is find a line that starts with a '.' and put the alphanumeric in the scalar $titi, than scan the next line to match the alphanumeric and put it in scalar $toto. But it is generating an error and cannot use it.
This is just a rial code I wrote for the actual program, but as this part isn't functioning right I cannot add it to the other code. Thanking you for your help.