crazysniffable has asked for the wisdom of the Perl Monks concerning the following question:
My hokey solution to this is to use a rudimentary hash thusly:
but this becomes cumbersome as soon as I get weary of maintaining the %hash when adding new patterns.%hash = ( 'foo' => 'bar', 'Foo' => 'Bar', 'FOO' => 'BAR', 'foO' => 'baR', 'Is' => 'Was', ); $string =~ s/(foO)/$hash{$1}/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Matching: Case-Conservation
by dave_the_m (Monsignor) on Jun 02, 2004 at 22:13 UTC | |
by crazysniffable (Acolyte) on Jun 02, 2004 at 22:47 UTC | |
|
Re: Pattern Matching: Case-Conservation
by duff (Parson) on Jun 02, 2004 at 22:09 UTC | |
|
Re: Pattern Matching: Case-Conservation
by davido (Cardinal) on Jun 03, 2004 at 05:12 UTC | |
|
Re: Pattern Matching: Case-Conservation
by jfroebe (Parson) on Jun 02, 2004 at 22:07 UTC | |
|
Re: Pattern Matching: Case-Conservation
by andyf (Pilgrim) on Jun 02, 2004 at 22:21 UTC | |
|
Re: Pattern Matching: Case-Conservation
by TomDLux (Vicar) on Jun 03, 2004 at 02:04 UTC |