I am new to perl programming and would like to learn about parsing text files with perl. I have a text file that has incorrect formatting in it, and I would like to parse it into three.
Basically the file contains text similar to the following:
;out;asoljefsaiouerfas'pozsirt'z
mysql_query("SELECT * FROM Table WHERE (value='true') OR (value2='true') OR (value3='true') ");
1234 434 3454
4if[9put[e]9sd=09q]024s-q]3-=04i
select ta.somefield, tc.somefield
from TableA ta INNER JOIN TableC tc on tc.somefield=ta.somefield
INNER JOIN TableB tb on tb.somefield=ta.somefield
ORDER by tb.somefield
234 4536 234
and the list will be continued with this format.
So what I need to do is disassemble it three times. Namely, from above, receiving hash checks. The second is a mysql query, and the third is a parsing of three numbers. For some reason, I don’t understand how to do this. I use the "open" function in perl to get data from a text file. And then I try to use the "split" function for line breaks, but it turns out that the requests are not on the same line or in the template, so I can not use it in the way I understand.
Tofu source
share