Re: how to remove the letter n from a line of text
- From: Jürgen Exner <jurgenex@xxxxxxxxxxx>
- Date: Thu, 28 Feb 2008 18:27:39 GMT
pauls <pauls@xxxxxxxxxx> wrote:
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
Again, I cannot reproduce your problem based on your verbal description:
C:\tmp>type t.pl
use warnings; use strict;
my $my_variable = '3.5n';
$my_variable =~ s/n/e-9/;
print $my_variable;
C:\tmp>t.pl
3.5e-9
Is there a specific reason why you don't post a minimal self-contained
script that produces your problem as recommended in the posting guidelines?
jue
.
- 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
- Re: how to remove the letter n from a line of text
- From: pauls
- how to remove the letter n from a line of text
- Prev by Date: Re: Generate an associative array from a file
- Next by Date: Re: Help with script
- 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
|
|