But this code doesn't compile...

karls-mac-mini:playground karl$ perl -c ./choroba.pl Global symbol "$max_count" requires explicit package name (did you for +get to declare "my $max_count"?) at ./choroba.pl line 14. Global symbol "$sum" requires explicit package name (did you forget to + declare "my $sum"?) at ./choroba.pl line 14. Global symbol "%count" requires explicit package name (did you forget +to declare "my %count"?) at ./choroba.pl line 14. Global symbol "$sum" requires explicit package name (did you forget to + declare "my $sum"?) at ./choroba.pl line 14. Global symbol "%count" requires explicit package name (did you forget +to declare "my %count"?) at ./choroba.pl line 14. Global symbol "$max_count" requires explicit package name (did you for +get to declare "my $max_count"?) at ./choroba.pl line 14. Global symbol "$expression" requires explicit package name (did you fo +rget to declare "my $expression"?) at ./choroba.pl line 16. Global symbol "$sum" requires explicit package name (did you forget to + declare "my $sum"?) at ./choroba.pl line 16. Unmatched right curly bracket at ./choroba.pl line 17, at end of line syntax error at ./choroba.pl line 17, near "}" ./choroba.pl has too many errors.

Update: It compiles. I copied the code from the download link into an emacs buffer as i did it many thousand times before. For some unknown reason the result was broken. I never observed this before. I'm very sorry. And to be honest: I couldn't hardly imagine that choroba should have posted something that doesn't compile.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help


In reply to Re: Sum to 100 at Rosetta Code by karlgoethebier
in thread Sum to 100 at Rosetta Code by choroba

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.