in reply to Writing file

You're on the right track. However, you should use the regex to extract not only the value you want to change but also the rest of the line you don't wish to change, such as

if (/^(\S+\s+)(\S+)(\s.*)/) { print $1 . log10($2) . $3 . "\n"; }
or like this:
my($name, $num, $rest) = split " ", $_, 3; print $name . " " . log10($num) . " " . $rest;

Update: I see now that you want to change each numerical value to its log. In that case, I'd definitely recommend split, eg.

my($name, @num) = split " "; print $name; for my $num (@num) { print " " . log10($num); } print "\n";
or
my($name, @num) = split " "; my @log10; for my $num (@num) { push @log10, log10($num); } print $name, " ", join(" ", @log10), "\n";