# Usage: perl thermoupdate.pl 12000 # in case you are at the 12000 mark. open(IN,"thermometer_tmpl.svg"); my $buf = ; close(IN); my $amt = $ARGV[0]; my $height = 20000; $n = 10 * $amt/$height; # floating point 0-10 my ($min,$mid,$max) = ('$0','$10,000','$20,000'); $buf =~ s/height="10"/height="$n"/; $buf =~ s/Foo/$min/; $buf =~ s/Bar/$mid/; $buf =~ s/Baz/$max/; open(OUT,"thermo_live.svg"); print OUT $buf; close(OUT); system("rsvg-convert -o thermometer.png thermo_live.svg");