Re: i say literal; perl says metacharacter

2006-03-10 Thread Chas Owens
On 3/10/06, tom arnall <[EMAIL PROTECTED]> wrote: > the following script is intended to uppercase every character preceded by [?.] > and one or two spaces: > > ($f,$g)=/([?.] {1,2})([a-z])/s; > $h = uc $g; > s/$f$g/$f$h/s; > > in the third line however perl interprets the [.?] in $f as a metacharac

Re: i say literal; perl says metacharacter

2006-03-10 Thread John W. Krahn
tom arnall wrote: > the following script is intended to uppercase every character preceded by > [?.] > and one or two spaces: > > ($f,$g)=/([?.] {1,2})([a-z])/s; > $h = uc $g; > s/$f$g/$f$h/s; > > in the third line however perl interprets the [.?] in $f as a metacharacter. > is there any way

Re: i say literal; perl says metacharacter

2006-03-10 Thread Shawn Corey
Tom Phoenix wrote: On 3/10/06, tom arnall <[EMAIL PROTECTED]> wrote: is there any way to get perl to interpret the contents of $f as a literal? I think you're looking for the quotemeta() function. Hope this helps! --Tom Phoenix Stonehenge Perl Training You can also use the \Q meta-charact

Re: i say literal; perl says metacharacter

2006-03-10 Thread Tom Phoenix
On 3/10/06, tom arnall <[EMAIL PROTECTED]> wrote: > is there any way to get perl to interpret the contents of $f as a literal? I think you're looking for the quotemeta() function. Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

i say literal; perl says metacharacter

2006-03-10 Thread tom arnall
the following script is intended to uppercase every character preceded by [?.] and one or two spaces: ($f,$g)=/([?.] {1,2})([a-z])/s; $h = uc $g; s/$f$g/$f$h/s; in the third line however perl interprets the [.?] in $f as a metacharacter. is there any way to get perl to interpret the contents o