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

bro hippo for your info Replacement string are in some external file :(
  • Comment on Re^2: Need to replace string from external file

Replies are listed 'Best First'.
Re^3: Need to replace string from external file
by hippo (Archbishop) on Nov 06, 2017 at 12:17 UTC
Re^3: Need to replace string from external file
by bhupi70007 (Novice) on Nov 06, 2017 at 11:58 UTC
    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 ...
      "...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