Gossamer Forum
Home : General : Perl Programming :

math in Perl

Quote Reply
math in Perl
Hi all!

Please explain to me, or show an example of how to do the basic math in Perl:

1+1=2

1*2=2

2-1=1

4/2=2

... etc.

Thank you!


Pasha

------------------
webmaster@find.virtualave.net
http://find.virtualave.net
Quote Reply
Re: math in Perl In reply to
Thanks Alex,

How about: 2 times 2?
2*2=4

------------------
webmaster@find.virtualave.net
http://find.virtualave.net
Quote Reply
Re: math in Perl In reply to
 
Same as divided by:

$test = 2*2;
print $test;

adam
Quote Reply
Re: math in Perl In reply to
Umm..

print 1 + 1;
print 2 + 2;
$test = 6 / 3;
print $test;

Does that help?

Alex
Quote Reply
Re: math in Perl In reply to
Hey, thanks! Smile

------------------
webmaster@find.virtualave.net
http://find.virtualave.net