Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there a passably elegant way to persuade a Perl here document to repeat lines, e.g. under control of an external foreach?
I'm trying to generate a sequence of routing commands like
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
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.
MarkMLl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: hiccoughing here documents
by kcott (Archbishop) on Aug 12, 2017 at 03:26 UTC | |
Re: hiccoughing here documents
by AnomalousMonk (Archbishop) on Aug 11, 2017 at 22:20 UTC | |
Re: hiccoughing here documents
by NetWallah (Canon) on Aug 11, 2017 at 22:22 UTC | |
Re: hiccoughing here documents
by NetWallah (Canon) on Aug 12, 2017 at 18:02 UTC | |
Re: hiccoughing here documents
by Paladin (Vicar) on Aug 11, 2017 at 22:00 UTC | |
Re: hiccoughing here documents
by Your Mother (Archbishop) on Aug 11, 2017 at 21:50 UTC | |
Re: hiccoughing here documents
by Anonymous Monk on Aug 12, 2017 at 09:29 UTC | |
by Anonymous Monk on Aug 12, 2017 at 15:55 UTC | |
by AnomalousMonk (Archbishop) on Aug 14, 2017 at 18:48 UTC |
Back to
Seekers of Perl Wisdom