Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: CPAN::INDEX problemby ww (Archbishop) |
on Jun 11, 2013 at 22:24 UTC ( [id://1038355]=note: print w/replies, xml ) | Need Help?? |
I don't understand your question about your "small program," but I can tell you that as posted, it won't compile NOR "ask for a package NOR anything else expect tell you that $n "requires explicit package name." That means you didn't declare it with my or our or anything else that would satisfy strict.
On the possibility that the program is intended to look something like this:
Note the semi-colons... and the revised comment about the value of $n: Yours would be accurate only if the input were 0.00000... One other possibility occurs -- that that line containing 0.00000 is intended to reflect user input. If so, refer to the above about missing semicolons and declarations. For a clear explanation of your final line of code, using the ternary operator, please see http://perldoc.perl.org/perlop.html for its syntax and use. Also, please read and heed the instructions around the text-input box -- where you typed this node. Use <c>...</c> tags around your code... and per Markup in the Monastery (which you should also read), please don't use <pre>...</pre> tags.
In Section
Seekers of Perl Wisdom
|
|