Greetings Monks
Im a all new to Perl, and have dreams of one day reaching the Perl Niavarna - but before that I need studdy for a few years.
Thus my first question.
This is my project.
#Write a program that computes the circumference of a circle with a radius of 12.5
#Circumference is 2(pi) times the radius (approximately 2 times 2.141592654).
#The answer you get should be about 78.5
This is how I solved it
$pi = 3,141592654;
$resultat = 2*$pi*12,5;
print "$resultat";
quite simpel - but when I run this code in Komodo Personal 4.0 I get the following messages:
-----------------------------------------------------
Useless use of a constant in void context at
C:\Users\Max\Desktop\Perl Arbejde\opgave1.pl line 6.
72
Useless use of a constant in void context at
C:\Users\Max\Desktop\Perl Arbejde\opgave1.pl line 7.
-----------------------------------------------------
It says that I got a useless use of a constant in void
context ? I can't find out if I can boil down my code
anymore ? It is really anoying that it also gives the
result 72 when that not the corect result. Its really
strange.
Many thanks for reaching this point in my question.
Htorne
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.