in reply to file parsing
Note the use of \Q to protect a literal string in a regex. The three dots are not something to fill in but precisely three dots here. This is (in scalar context) a flip-flop operator evaluating either the left or the right expression according to its state. To catch beginning and end markers on the same line, you'd have to replace the three dots by two dots. Also look up the -n and the -i switch in perlrun if you like to edit your files in-place with a single short command line.#!/usr/bin/perl while (<>) { next if m{^\Q<?xml version="1.0" encoding="UTF-8"?>} ... m{</table>}; print; }
|
|---|