semipro has asked for the wisdom of the Perl Monks concerning the following question:
In this case the value he is extracting is: -39.9999400000. but he marks it as a string '-39.9999400000'. But I would like to insert it in an equation to calculate something. So I need somehow a conversion or an alternative. Thank you again very much for your attention and help! Best regards#!/usr/bin/perl -w use strict; my $resultnow='C:/Users/user/Desktop/solution.dat'; open (FILE, '<', $resultnow) or die "$resultnow File not found : $!"; my @lines = <FILE>; my $valuenow= $lines[9]; my @items=split' ',$valuenow; use Data::Dumper; #print Dumper(@items); my $val=Dumper($items[-1]); print $val; close (FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string to number via data dumper
by Happy-the-monk (Canon) on Sep 28, 2013 at 12:10 UTC | |
by Anonymous Monk on Sep 28, 2013 at 12:14 UTC | |
by semipro (Novice) on Sep 28, 2013 at 12:46 UTC | |
by kcott (Archbishop) on Sep 28, 2013 at 13:37 UTC | |
by Laurent_R (Canon) on Sep 28, 2013 at 14:54 UTC | |
by semipro (Novice) on Sep 29, 2013 at 09:42 UTC | |
|
Re: string to number via data dumper
by kcott (Archbishop) on Sep 28, 2013 at 13:18 UTC | |
|
Re: string to number via data dumper
by Athanasius (Archbishop) on Sep 28, 2013 at 13:32 UTC | |
|
Re: string to number via data dumper (strings are number, perlnumber)
by Anonymous Monk on Sep 28, 2013 at 12:09 UTC |