in reply to dodgy sub
maybe you could try swapping hello and hi?
$what =~ s/\Q$find/$replace/;
Otherwise, you may get nasty errors
Besides, if there are strange chars in $find ( \, +, *, (, [ or the like), better write:$string = str_replace("Hello", "Hi", "Hello My Name Is Elfyn");
$what =~ s/\Q$find/$replace/;
Otherwise, you may get nasty errors
Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
---|
In Section
Seekers of Perl Wisdom