Hi all
code::
open (FH1, "list.txt") || die "Can't find the data file";
print "Enter the name you need";
$input = <STDIN>;
while(<FH1>)
{
$x =0;
$data1 = $_;
if($_ =~/load/)
{
$x = 1;
print $data1;
}
}
if($x)
{
print "No match found ";
}
close(FH1);
if the contents of the list file is
load=ram
load=sam
when I run my perl script it should ask for a input if I give the Input as
" test" then the contents of the file should be changed as
load=test
load=test
can anyone tell me how to do this,I have given the code I did so for..
Thnks in advance
code::
open (FH1, "list.txt") || die "Can't find the data file";
print "Enter the name you need";
$input = <STDIN>;
while(<FH1>)
{
$x =0;
$data1 = $_;
if($_ =~/load/)
{
$x = 1;
print $data1;
}
}
if($x)
{
print "No match found ";
}
close(FH1);
if the contents of the list file is
load=ram
load=sam
when I run my perl script it should ask for a input if I give the Input as
" test" then the contents of the file should be changed as
load=test
load=test
can anyone tell me how to do this,I have given the code I did so for..
Thnks in advance
Comment