I'm using InstallShield to install a custom app at several locations.
On each target machine, is a custom cfg file with unique IP addresses.
InstallShield will overwrite this file during installation, but I'd like
to extract these addresses and insert them into the newly installed cfg
file.  I wrote a dos batch file that extracts this data from the old cfg
text file and inserts it into the new cfg text file but my manager wants
it in perl.

Being new to perl, I know how to search for strings.  I know how to
explicitly search and replace a string.  What I don't know how to do is
search for a string, make that string a variable, and then use that
variable in a search and replace statement so that I can run this script
at all my sites.

Here's what I'm using to search for a string...

open FILE, "<config.cfg" or die "can't open config.cfg: $!";
my @lines = <FILE>;
print grep /OAM/i, @lines;

When I run this against config.cfg, it gives me the string OAM...  Can I
make that a variable?



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to