LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   simple perl script not working (http://www.linuxquestions.org/questions/linux-newbie-8/simple-perl-script-not-working-734077/)

vinaytp 06-19-2009 01:43 AM

simple perl script not working
 
hi all.......

$string='summary';
if($test =~m/($string)/i)
{
$test=~ s/$1/$string/g;
}

here substitution not taking place even if summary word present in $test
is there any mistake in the code....

can anyone please help me...

Thanks in advance....

vinaytp 06-19-2009 02:13 AM

Quote:

Originally Posted by vinaytp (Post 3579180)
hi all.......

$string='summary';
if($test =~m/($string)/i)
{
$test=~ s/$1/$string/g;
}

here substitution not taking place even if summary word present in $test
is there any mistake in the code....

can anyone please help me...

Thanks in advance....

I got it correct i was matching test instead of text ...that was the mistake...


All times are GMT -5. The time now is 10:48 PM.