On Mon, May 08, 2006 at 08:35:52AM -0700, Xuning Wang wrote: > Thanks for reply. The question is easily solvable if > it is in the same file as the perl script. You can use > single quotes or backslash to modify the string. > > But as I stated in the message, the "$1.12" was in a > text file along with other things, say you have a > sentence like this in a file: Apple $1.12. You can't > modify the file itself. So it's hard to utilize "\" or > use single quotes because you have to first read the > sentence from a file.
And my example, which you will find below since you top posted and I can't be bothered to rearrange things, shows the equivalent of reading from a file with nary a backslash in sight, save the one you used in the substitution. > --- Paul Johnson <[EMAIL PROTECTED]> wrote: > > > > Something else is going on, but I can't say exactly where. > > > > $ echo '$1.12' | perl -ple 's/\$//' > > 1.12 > > > > Perhaps you have some other interpolation going on where you don't > > need it? -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>