Re: how to remove the letter n from a line of text
- From: pauls <pauls@xxxxxxxxxx>
- Date: Thu, 28 Feb 2008 08:48:37 -0800
Jürgen Exner wrote:
pauls <pauls@xxxxxxxxxx> wrote:I want to replace all occurances of the letter n in a line of text.
The confusion I am having is due to the fact that n denotes a new line in reg expressions.
No, it doesn't. "\n" denotes a newline when interpolated in a double quoted
string.
I tried to do this:
s/n/fred/; to replace the letter n with fred. But, it did not happen.
Works for me
use strict; use warnings;
$_ = 'banana';
s/n/fred/g;
print;
C:\tmp>t.pl
bafredafreda
jue
Let me be more clear and correct myself:
What I was actually trying was this:
$my_variable =~ s/n/e-9/;
where the variable $my_variable has this in it: 3.5n
and I was hoping to change it to:
3.5e-9
when I read-in the data and do the following (below) on $_
s/n/e-9/;
it works!
But if I do it like this:
$my_variable =~ s/n/e-9/;
The n is removed but not replaced by the e-9
Thanks
P.
.
- Follow-Ups:
- Re: how to remove the letter n from a line of text
- From: Tad J McClellan
- Re: how to remove the letter n from a line of text
- From: Jürgen Exner
- Re: how to remove the letter n from a line of text
- From: John Bokma
- Re: how to remove the letter n from a line of text
- References:
- how to remove the letter n from a line of text
- From: pauls
- Re: how to remove the letter n from a line of text
- From: Jürgen Exner
- how to remove the letter n from a line of text
- Prev by Date: Re: unicode via DBI on linux to sql server 2005?
- Next by Date: Re: how to remove the letter n from a line of text
- Previous by thread: Re: how to remove the letter n from a line of text
- Next by thread: Re: how to remove the letter n from a line of text
- Index(es):
Relevant Pages
|
|