Jump to content

Adding sub/superscriptions to a Perl/Tk program

Andrew Ivanov's Photo
Posted Mar 30 2010 10:08 AM
3327 Views

How can I write for example m/sec2 in a Perl/Tk program?

Tags:
1 Subscribe


2 Replies

0
  jwgaynor's Photo
Posted Jun 26 2010 08:43 AM

The CARAT (^) is used for exponentiation just as the SLANT (/) is used for divide. So I would assume that in your program, 'm' and 'sec' are variables and you could write the expression like:

$some_val = $m / ($sec^2);

You will also probably require a math module and should refer to CPAN.org fopr that

 : Jul 08 2010 06:10 PM
In which sort of widget do you want to show a superscript?