newperluser
Programmer
I'm new to PERL so please forgive me if this seem like a silly question..
I need to open a file and parse throgh it replacing one value with another
I'm thinking something like this sould work .. but it does not
if (open TESTFILE, "testfile.txt")
{
while(<TESTFILE>)
if (/oldvalue/)
{
s/oldvalue/newvalue/;
}
}
close TESTFILE;
I'm sure I am missing something simple - but I'm not seeing it.
Thanks
I need to open a file and parse throgh it replacing one value with another
I'm thinking something like this sould work .. but it does not
if (open TESTFILE, "testfile.txt")
{
while(<TESTFILE>)
if (/oldvalue/)
{
s/oldvalue/newvalue/;
}
}
close TESTFILE;
I'm sure I am missing something simple - but I'm not seeing it.
Thanks