perlquestion
Anonymous Monk
<p>Is there a passably elegant way to persuade a Perl here document to repeat lines, e.g. under control of an external foreach?</p>
<p>I'm trying to generate a sequence of routing commands like</p>
<code>ip rule add fwmark 0x0201/0xffff table 201
ip rule add fwmark 0x0200/0xffff table 200
ip route add default via 172.27.201.1 dev eth1.201 table 201
ip route add default via 172.27.200.1 dev eth1.200 table 200</code>
<p>and while putting them in a here document is by far the most readable approach it would be a great improvement if the repeated lines- where the count might vary- could be generated on the fly.</p>
MarkMLl
17