私は初めてですPerl
<nst:root arg='1' arg2='2' arg3='3'>
<a>1</a>
<b>2</b>
</nst:root>
私は2つの変数が欲しい、
$root = '<nst:root arg='1' arg2='2' arg3='3'>';
$rootClose = '</nst:root>';
これには正規表現が必要です。行ごとに読めないからです。私のxmlファイルは以下のようにもなります
<nst:root arg='1' arg2='2' arg3='3'><a>1</a><b>2</b></nst:root>
完全なファイルを読みたくありません。何百ものファイルがあり、1 つのファイルに 10,000 行を超える行が含まれているためです。