Hi,
    I want to match a pattern and replace with another string.Since the "?"
is also one of the character present in the string.
I am not able to do it.
Please help to how to make "?" acceptable in the string used for pattern
matching.

My problem is:
Here in the script,how to make the Perl to accept "?" symbol in the string
for pattern matching.

my $pattern="<a href=\"yahoo.com/getfile.php?id=1894\">Dennis";
my $replace="<script>\ndocument.write(\"<a href =
\"url+\"/getfile.php?id=1894\">Dennis";
open(IN, "<$filetoopen") || die "cannot open file\n";
open(OUT, ">$test") || die "cannot open file\n";
while (<IN>){
if (/$pattern/){
        s/$pattern/$replace/g;
}

Tell me in what way I need to give the "?'" symbol in the $pattern string,So
that string will be accepted.

With Thanks inadvance,
Prabu.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.620 / Virus Database: 399 - Release Date: 3/11/2004




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to