Shobha Deepthi
Shobha Deepthi

Reputation: 31

Generatings Charts in perl

I am trying to understand an old code which generated charts. It takes arrays as input for x and y axis and generates graphs using print statements. I debug the programs to see for loaded modules, but it is not making use of any Perl Modules to do so. I am wondering if anyone could help me in understanding this,

print "\@with line\n";
print "\@  line on\n";
print "\@  line loctype view\n";
printf "\@  line %.3f, 0.2, %.3f, 0.8\n", $viewx, $viewx;
print "\@  line linewidth 2\n";
print "\@  line linestyle 1\n";
print "\@  line arrow 0\n";
print "\@line def\n";

print "\@with string\n";
print "\@  string on\n";
print "\@  string loctype view\n";
printf "\@  string %.3f, %.3f\n", $labx, 0.25   unless $top;
printf "\@  string %.3f, %.3f\n", $labx, 0.75   if     $top;

Upvotes: 0

Views: 185

Answers (1)

Sdaz MacSkibbons
Sdaz MacSkibbons

Reputation: 28676

Those are just print statements. The "\@" escapes the @ character, so it's not actually using any arrays. %.3f in the 3 printf lines is a format specifier, which prints the floating point values passed as arguments (i.e. $viewx, $labx, 0.25, 0.75) to 3 decimal places.

There's not really much there to understand. Don't see how you mean that this prints charts.

Upvotes: 3

Related Questions