Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Can Perl do calculations?
by davido (Cardinal) on Jan 08, 2005 at 05:52 UTC

    Yes, Perl can do calculations. Perl has all the standard mathematical operators; + (plus), - (minus), * (times), / (divide), and so on.

    If you want it to calculate PI to 300 digits, Perl is there for you too, but you've got to learn to program. A good place to start learning Perl is to read "Learning Perl", published by O'Reilly & Associates. You'll find it in most larger bookstores, as well as Amazon.


Re: Can Perl do calculations?
by rozallin (Curate) on Jan 08, 2005 at 07:21 UTC
    In addition to the excellent book that davido suggested, you might also find Simon Cozens' Beginning Perl, which is available free online, useful. Chapter 2: Working with Simple Values (PDF format) explains data types, variables and operators and is a good introduction to performing calculations using Perl.

    Rozallin J. Thompson
Re: Can Perl do calculations?
by gopalr (Priest) on Jan 08, 2005 at 09:17 UTC

    We can do calculation by using the below

    * + / -

    and Math::Complex Perl modules also do the engineering, science, and mathematics

Re: Can Perl do calculations?
by Mr. Lee (Scribe) on Jan 12, 2005 at 19:25 UTC
    Seriously, what about the opposite question:
    Is there any programming language that can't?
    Mr. Lee