tej has asked for the wisdom of the Perl Monks concerning the following question:
I have a string as, $string="Referring Hospital Triage Time <183> 2 h (N <26> 191)"; $pre_str=Referring Hospital;
I want to remove $pre_str from $string. I am writing the following code
$str1=$string; $str1=~s/\Q$pre_str\E//;
When i print $str1 I get output as "Referring Hospital Triage Time <183> 2 h (N <26> 191)"
Why is this happening? Please help!!
Thank you..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with substitution
by jethro (Monsignor) on Mar 24, 2011 at 12:32 UTC | |
|
Re: Help with substitution
by JavaFan (Canon) on Mar 24, 2011 at 12:00 UTC | |
|
Re: Help with substitution
by Nikhil Jain (Monk) on Mar 24, 2011 at 12:06 UTC | |
|
Re: Help with substitution
by TomDLux (Vicar) on Mar 25, 2011 at 01:28 UTC |