|
Posted by Jürgen Exner on February 28, 2008, 1:27 pm
Please log in for more thread options
>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
|