]> git.donarmstrong.com Git - perltidy.git/commitdiff
update docs
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 21 Sep 2020 01:56:14 +0000 (18:56 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 21 Sep 2020 01:56:14 +0000 (18:56 -0700)
docs/BugLog.html
docs/perltidy.html
local-docs/BugLog.pod

index c3652f3bfb4effc27847c074a66f9cac00797a91..30b1a49d02f912db05838c52422a34c3a1295d0e 100644 (file)
 
 <dl>
 
+<dt id="Switched-from-using-an-eval-block-to-the--can-function-for-sub-finish_formatting"><b>Switched from using an eval block to the -</b>can() function for sub finish_formatting&gt;</dt>
+<dd>
+
+<p>This is not a bug, but is cleaner coding and insures that error messages get reported. This change was made 20 Sep 2020.</p>
+
+</dd>
+<dt id="fixed-uninitialized-value-reference"><b>fixed uninitialized value reference</b></dt>
+<dd>
+
+<p>The following message was generated during automated testing Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12079. Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12089. Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12097.</p>
+
+<p>The problem could be simplified to running perltidy -wn on this snippet:</p>
+
+<pre><code>     __PACKAGE__-&gt;load_components( qw(
+&gt;         Core
+&gt; 
+&gt;     ) );</code></pre>
+
+<p>This was fixed 20 Sep 2020 in &#39;fixed_uninitialized_value&#39;, 8d6c4ed.</p>
+
+</dd>
 <dt id="fix-incorrect-parsing-of-certain-deprecated-empty-here-docs"><b>fix incorrect parsing of certain deprecated empty here-docs </b></dt>
 <dd>
 
@@ -55,7 +76,7 @@
 <p>A change was made to allow a &#39;=&gt;&#39; at the end of a line to align vertically, provided that it aligns with two or more other &#39;=&gt;&#39; tokens. This update was 14 Sep 2020, &#39;Allow line-ending &#39;=&gt;&#39; to align vertically&#39;, ea96739.</p>
 
 </dd>
-<dt id="fixed-uninitialized-value-reference"><b>fixed uninitialized value reference</b></dt>
+<dt id="fixed-uninitialized-value-reference1"><b>fixed uninitialized value reference</b></dt>
 <dd>
 
 <p>The following message was generated when running perltidy on random text:</p>
@@ -75,7 +96,7 @@
 <p>from becoming a zero length file. This could cause problems with other software. Fixed 13 Sep 2020, &#39;do not create a zero length file by deleting semicolons&#39;, b39195e.</p>
 
 </dd>
-<dt id="fixed-uninitialized-value-reference1"><b>fixed uninitialized value reference</b></dt>
+<dt id="fixed-uninitialized-value-reference2"><b>fixed uninitialized value reference</b></dt>
 <dd>
 
 <p>The following message was generated when running perltidy on random text:</p>
 <p>This was fixed 13 Sep 2020 in &#39;fixed unitialized variable problem &#39;, adb2096.</p>
 
 </dd>
-<dt id="fixed-uninitialized-value-reference2"><b>fixed uninitialized value reference</b></dt>
+<dt id="fixed-uninitialized-value-reference3"><b>fixed uninitialized value reference</b></dt>
 <dd>
 
 <p>The following message was generated when running perltidy on random text:</p>
 <p>This was fixed 13 Sep 2020 in &#39;fixed unitialized variable problem&#39;, 5bf49a3.</p>
 
 </dd>
-<dt id="fixed-uninitialized-value-reference3"><b>fixed uninitialized value reference</b></dt>
+<dt id="fixed-uninitialized-value-reference4"><b>fixed uninitialized value reference</b></dt>
 <dd>
 
 <p>The following message was generated when running perltidy on random text:</p>
index 510d07d29381c3f7213bebf9e58cd47b23d444b1..bc17a8b947fe41274b134f582a9402a8e6fc754e 100644 (file)
 
 <p><b>-skp</b> or <b>--space-keyword-paren</b></p>
 
-<p>You will probably also want to use the flag <b>-sfp</b> (next item) too.</p>
+<p>You may also want to use the flag <b>-sfp</b> (next item) too.</p>
 
 </dd>
 <dt id="Space-between-all-function-names-and-opening-parens">Space between all function names and opening parens</dt>
 <dd>
 
-<p>When an opening paren follows a function the default is not to introduce a space. To cause a space to be introduced use:</p>
+<p>When an opening paren follows a function the default and recommended formatting is not to introduce a space. To cause a space to be introduced use:</p>
 
 <p><b>-sfp</b> or <b>--space-function-paren</b></p>
 
 
 <p>You will probably also want to use the flag <b>-skp</b> (previous item) too.</p>
 
+<p>The reason this is not recommended is that spacing a function paren can make a program vulnerable to parsing problems by Perl. For example, the following two-line program will run as written but will have a syntax error if reformatted with -sfp:</p>
+
+<pre><code>  if ( -e filename() ) { print &quot;exists\n&quot;; }
+  sub filename { return $0 }</code></pre>
+
+<p>The syntax error can be removed if the line order is reversed, so that Perl parses &#39;sub filename&#39; first.</p>
+
 </dd>
 <dt id="spp-n-or---space-prototype-paren-n"><b>-spp=n</b> or <b>--space-prototype-paren=n</b></dt>
 <dd>
 
 <ul>
 
-<li><p>This parameter only applies if the opening brace is preceded by an &#39;=&#39; or &#39;=&gt;&#39; or &#39;,&#39;.</p>
+<li><p>This parameter only applies if the opening brace is preceded by an &#39;=&#39; or &#39;=&gt;&#39;.</p>
 
 </li>
 <li><p>This parameter only applies if the contents of the container looks like a list. The contents need to contain some commas or &#39;=&gt;&#39;s at the next interior level to be considered a list.</p>
index 0223f16e87408a38f84a78e439797c92136b0ba7..46094a3e9c04462f575c904b0a6cd5231342f214 100644 (file)
@@ -5,6 +5,28 @@ found with the help of automated random testing.
 
 =over
 
+=item B<Switched from using an eval block to the ->can() function for sub finish_formatting>
+
+This is not a bug, but is cleaner coding and insures that error messages get reported.
+This change was made 20 Sep 2020.
+
+
+=item B<fixed uninitialized value reference>
+
+The following message was generated during automated testing
+ Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12079.
+ Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12089.
+ Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12097.
+
+The problem could be simplified to running perltidy -wn on this snippet:
+
+     __PACKAGE__->load_components( qw(
+>         Core
+> 
+>     ) );
+
+This was fixed 20 Sep 2020 in 'fixed_uninitialized_value', 8d6c4ed.
+
 =item B<fix incorrect parsing of certain deprecated empty here-docs >
 
 The following snippet was being incorrecly parsed: