in reply to Re^2: string to number via data dumper
in thread string to number via data dumper
here I tryed to make a sum. with "my $n= "$val+8";", so that I can obtain a vlue like -31.9999400000 (instead of '-39.9999400000'+8). But unfortunately that does not work. So how can I solve this problem? (that was the reason why I thought it is a string value).#!/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]"); my $n= "$val+8"; print $n; close (FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: string to number via data dumper
by kcott (Archbishop) on Sep 28, 2013 at 13:37 UTC | |
|
Re^4: string to number via data dumper
by Laurent_R (Canon) on Sep 28, 2013 at 14:54 UTC | |
by semipro (Novice) on Sep 29, 2013 at 09:42 UTC |