I'd like to store everything starting from 'line=ULMNm' till before the next 'line=ULMNm' as one string. Previously, I always used to define the input line separator ($/) like this:line=ULMNm 3 1fdy_07 N-ACETYLNEURAMINATE LYASE user + 1 3 RMSD = 1.06 A MATRIX: -0.3862 -0.2080 -0.8987 0.6457 0.6347 -0.4244 -0.6587 0 +.7442 0.1108 -16.917 -91.429 -35.632 D 47 SER A 57 SER.? D 48 THR A 56 THR.? D 165 LYS A 33 LYS~? line=ULMNm 3 2tmd_00 TRIMETHYLAMINE DEHYDROGENASE user + 1 3 RMSD = 1.15 A MATRIX: 0.9011 -0.4313 0.0445 -0.1032 -0.3130 -0.9441 -0.4211 -0 +.8462 0.3266 52.913 23.262 25.449 A 169 TYR A 41 TYR~? A 172 HIS A 95 HIS^? A 267 ASP A 98 ASP~?
to make the script read multiple lines instead of line by line.$/ = " ";
However, if I want to read another text file line by line in the same perl script, redefining $/ = "\n" doesn't work. I'm really bad with regex (and have no idea how exactly to get good at it, it baffles me how you guys can be so good). Could you tell me how to do this?
In reply to regex question: store multiple lines as a string by nurulnad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |