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:

#!//usr/bin/perl use strict; use warnings; # 1038343 #programa 1 print "hello, world.\n"; #programa 2 print "Gimme a number: "; # 0.0000; my $n = 0.00000; chomp($n = <STDIN>); #$n now holds whatever the input is +at STDIN print "The value $n is", $n ? "TRUE" : "False", "\n";

Note the semi-colons... and the revised comment about the value of $n: Yours would be accurate only if the input were 0.00000...
Otherwise the script behaves as expected.

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.

If you didn't program your executable by toggling in binary, it wasn't really programming!


In reply to Re: CPAN::INDEX problem by ww
in thread CPAN::INDEX problem by Raymond

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.