This is UNTESTED but it may help get you started:
#!/usr/bin/perl use warnings; use strict; my $file2 = 'File2'; open my $IN, '<', $file2 or die "Cannot open '$file2' $!"; my %data; while ( <$IN> ) { next unless /^([^=]+)=(.+)/; $data{ $1 } = $2; } close $IN; ( $^I, @ARGV ) = ( '.bak', 'File1' ); while ( <> ) { s/(\@([^\@]+)\@)$/ exists $data{ $2 } ? $data{ $2 } : $1 /e; print; }
In reply to Re: config tokens substitutions
by jwkrahn
in thread config tokens substitutions
by uandme2k2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |