<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## camelCase 很糟 你曾維護過別人的代碼嗎?你維護過像這樣的代碼嗎? ~~~ my $variableThatContainsData = someSubroutineThatMucksWithData( $someAwfulVariable ); ~~~ 混合大小寫單詞在 Perl 世界被稱為?_camelCase_,通常它的令人不悅之處是使 閱讀代碼更難。 甚至具有糟糕名稱的代碼使用下劃線也能變得更可讀: ~~~ my $variable_that_contains_data = some_subroutine_that_mucks_with_data( $some_awful_variable ); ~~~ ## warnings 和 strict 對于你希望維護、重用、及發布的任何程序,都應當具有下列代碼行: ~~~ #!/usr/bin/perl use strict; use warnings; ~~~ 啟用?`strict`?使 Perl 抱怨不確定的代碼結構,比如:未聲明的變量、祼字、 以及軟引用等。這些警告將導致 Perl 執行失敗。 ~~~ #!/usr/bin/perl use strict; $foo = 4; # undeclared variable error $foo = Bar; # bareword error my $bat = "foo"; print $$bat; # reference error ~~~ 啟用?`warnings`?使 Perl 甚至抱怨更多東東。但不像?`strict`,這些抱怨在 一般條件下并不嚴重。 ~~~ #!/usr/bin/perl use warnings; $a + 0; # void context warning # name used once warning # undef warning print "program continued\n"; # prints ~~~ 如果你想要?`warnings`?變得嚴重,告訴它: ~~~ use warnings FATAL => 'all'; $a + 0; # void warning and then exits print "program continued\n"; # doesn't print ~~~ ## 使用?`perltidy`?格式化 Perl 源代碼 選擇何種代碼風格是仁者見仁,智者見智的事情。但重要的是保持風格的一致性。 為了使格式化 Perl 源代碼更容易,你可以使用?[Perl::Tidy](https://metacpan.org/release/Perl-Tidy)?模塊隨付的?`perltidy`?工具。 例如,使用?_Perl 最佳實踐_?一書所推薦的風格來格式化源代碼: ~~~ $ perltidy -pbp myprogram.pl -o myprogram.formated.pl ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看