As was just pointed out to me recently, it is best to not use your scratchpad to post code in, as when someone checks this post out in the future, it is likely that code will change. If you don't mind, update your post to include the code instead of the link. For now, here it is:

#usr/bin/perl -w #=for comment #pseudocode: #start event loop # gather input, then act on input # actions are print statements #=cut $quit = 0; $answer = "blank"; while ($quit == 0) { print "Do you want to loop?\n"; $answer = <STDIN>; print $answer; }

From the looks of it, this code *should* run (untested), however because your shebang line is broken, the file won't process as code perl can interpret. It should be:

#!/usr/bin/perl

Beyond that, again, because you're not using

use strict; use warnings;

(which you should), you're not defining anything lexically.

Furthermore, in the code you did actually include in your post, your code has to go underneath the =cut, not embraced in it.

Update: you need to read perldoc perlpod. Also, if possible, perhaps you could retitle your post to something more descriptive such as "Problems with multiline comments" or some such.

Update2: I'm kind of sorry for the Slashdot-style Consideration note. I can't explain why I did that as it has been so long since I've seen it used. It just came out ;) Also, the recommended title should have stated "Problems with perlpod", not perldoc.


In reply to Re: simple newb question by stevieb
in thread simple newb question by filesurfer

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.