in reply to Re: Substitution for braces
in thread Substitution for braces
Is it the right way of coding. When I execute the program with the $Name_pre asOpen FH,file.txt; while (<$FH>) { $arr[$i].="$_"; } close ($FH); $text=$arr[$i]; $text =~ /<cc>([\s\S]+?)<\/cc>/; $Name_pre=$1; $Name=$1; $Name=~ s/&amp;/-/g; $Name=~ s/&/-/g; $Name =~ s/-$//g; $st=$Name; $char=chop($st); if($char eq '-') {$Name=~ s/$//g;} $arr[$i]=~ s/$Name_pre/$Name/g;
the program terminates giving an error at the linefg-&amp;&+(and(we-
as$arr[$i]=~ s/$Name_pre/$Name/g;
Unmatched ( in regex; marked by <-- HERE in m/fg-&amp;&+(and( +<-- HERE we- /
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Substitution for braces
by GrandFather (Saint) on Jul 08, 2009 at 09:48 UTC | |
by gem555 (Acolyte) on Jul 09, 2009 at 06:48 UTC | |
|
Re^3: Substitution for braces
by Utilitarian (Vicar) on Jul 08, 2009 at 10:17 UTC |