http://www.perlmonks.org?node_id=1012651


in reply to Using '#' at the beginning of a format?

When I first saw the Perl format thing, I thought it would be very cool. Well as it turns out, using printf() is usually far better for any kind of normal report.
#!/usr/bin/perl -w use strict; my @stuff = qw( large 90.12 small 12.34 medium 57.78 super 75.0 ); print "# Name Price\n", "# ---- -----\n"; while (my ($name,$price) = splice (@stuff,0,2)) { printf "%10s %8.2f\n", $name, $price; } __END__ Prints: # Name Price # ---- ----- large 90.12 small 12.34 medium 57.78 super 75.00