Personally I'd say something like "the full source code for the script discussed in this tutorial can be found in Appendix A" near the start, and give the full source code within the pod. Then during the tutorial, when you need to refer to particular sections of the source code, instead of just saying a line number, quote a few lines of code — the part under discussion and any extra lines necessary to understand it in context. If this is more than four lines, perhaps add some comments like ##line 18 so that readers can find their way around it.
You may also want to include the full script as a standalone file outside of the pod, but don't rely on this as the only way to provide it, as examples aren't typically installed.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|