in reply to Re^2: Need to replace string from external file
in thread Need to replace string from external file

To make you more clear my first file contain line like my name is % s My local machine ip is %d My second file contains value for %s i.e john,peter,mickey My third file contains value for %d i.e 10.0.1.2, 10.2.3.4 My output should be My name is John My name is Peter My name is mickey My local machine ip is 10.0.1.2 My local machine ip is 10.2.3.4 can you please help me on getting this output ...
  • Comment on Re^3: Need to replace string from external file

Replies are listed 'Best First'.
Re^4: Need to replace string from external file
by karlgoethebier (Abbot) on Nov 06, 2017 at 14:24 UTC
    "...make you more clear..."

    Make me clear: IP and name separated by comma or newline?

    BTW, output using sprintf as suggested by hippo using Path::Tiny:

    path($file)->spew_utf8( map { sprintf $text, $_ } @args );

    Not tested but should work. Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help