in reply to formatting substitute and arrays

1) try  s/old_value/sprintf("%.5f", new_value)/e;

2) should work something like :

 print PLOT (map {sprintf "%.5f", $_} @a), "\n" or  print PLOT (sprintf "%.5f"x@a, @a), "\n"