Arndt Jonasson wrote:
> Alexandre Jaquet <> writes:
>> Hi does someone could clear my mind and tell me what would mean :
>>
>> $loop_hs =~ s/\$HTML{\'$noteval\'}/\*HTML{\'$noteval\'}/g;
>
> It assumes that the variable $noteval has a value; let's say it contains
> "foo".
>
> Then the statement takes the string $loop_hs and in it replaces all
> occurrences of the character '$' with '*' when they are followed by
> "HTML{'foo'}".
Since there are several redundant backslashes, i.e.
$loop_hs =~ s/\$HTML{'$noteval'}/*HTML{'$noteval'}/g;
would do the same, it also means that the programmer isn't very good at
regular expressions in Perl.
--
Gunnar Hjalmarsson
Email:
http://www.gunnar.cc/cgi-bin/contact.pl