<pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
    <pre id="vvttv"></pre>

      <p id="vvttv"></p>

          <p id="vvttv"></p>

                <p id="vvttv"></p>

                <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                  <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                    <p id="vvttv"></p>


                    ????? ????????/?????

                    ????????????????
                    ????????
                    ???????????????????
                    ??????????
                    ?塢????????????
                    ??????????????????????????
                    ??????????
                    ????г?????????????
                    ????ù??????????
                    ????ù??????鴴???????
                      1??(??)????
                      2????
                      3????

                    ????????????????
                        ????潲??????????У?????????±???????е????????磬??????????????@array???????????
                        $scalar = $array[2];
                        ????????????????????????????????????????????????????????????????????д???????????????????????д???????????????????????????????????????????£?
                    1 : #!/usr/local/bin/perl
                    2 :
                    3 : while ($inputline = <STDIN>) {
                    4 :   while ($inputline =~ /\b[A-Z]\S+/g) {
                    5 :     $word = $&;
                    6 :     $word =~ s/[;.,:-]$//; # remove punctuation
                    7 :     for ($count = 1; $count <= @wordlist;
                    8 :         $count++) {
                    9 :       $found = 0;
                    10:       if ($wordlist[$count-1] eq $word) {
                    11:         $found = 1;
                    12:         $wordcount[$count-1] += 1;
                    13:         last;
                    14:       }
                    15:     }
                    16:     if ($found == 0) {
                    17:       $oldlength = @wordlist;
                    18:       $wordlist[$oldlength] = $word;
                    19:       $wordcount[$oldlength] = 1;
                    20:     }
                    21:   }
                    22: }
                    23: print ("Capitalized words and number of occurrences:\n");
                    24: for ($count = 1; $count <= @wordlist; $count++) {
                    25:   print ("$wordlist[$count-1]: $wordcount[$count-1]\n");
                    26: }
                        ???н?????£?
                    Here is a line of Input.
                    This Input contains some Capitalized words.
                    ^D
                    Capitalized words and number of occurrences:
                    Here: 1
                    Input: 2
                    This: 1
                    Capitalized: 1
                        ?????????δ???????????????????????????????????????????????д??????????????????Σ???????????$word????????????????????????????????????7~15??????@wordlist?а???????????飬???????????$word????@wordcount???????????????????????????г????????@wordlist??????????$word????16~20?и?@wordlist??@wordcount?????????????
                    ????????
                        ???????????????????????????????Щ?????????@wordlist????????????????????????????????????????????μ??????????????????б?????????????????????????????б??y?????????????????
                        ??Щ?????????????????????????????±??????????????????Perl??????????????飬??????????????????????????????????????????????飬??й?????
                        ?????????????????????????????????Perl???%???????????????????????@??????????????????????%????????????????????????????????????????????????
                    ???????????????????
                        ??????????±??????κμ?/????????????????????$?????????±????????Χ?????????磺
                    $fruit{"bananas"}
                    $number{3.14159}
                    $integer{-7}
                        ?????????????±??磺
                        $fruit{$my_fruit}
                    ??????????
                        ?????????????????????????????????????$fruit{"bananas"} = 1?? ??1????????????%fruit?±??bananas???????????????????????????????????%fruit??δ??ù????????????
                        ?????????ù??????????????????????????????ù????????д????????????????????????????????
                    1 : #!/usr/local/bin/perl
                    2 :
                    3 : while ($inputline = ) {
                    4 :   while ($inputline =~ /\b[A-Z]\S+/g) {
                    5 :     $word = $&;
                    6 :     $word =~ s/[;.,:-]$//; # remove punctuation
                    7 :     $wordlist{$word} += 1;
                    8 :   }
                    9 : }
                    10: print ("Capitalized words and number of occurrences:\n");
                    11: foreach $capword (keys(%wordlist)) {
                    12:   print ("$capword: $wordlist{$capword}\n");
                    13: }
                        ???н?????£?
                    Here is a line of Input.
                    This Input contains some Capitalized words.
                    ^D
                    Capitalized words and number of occurrences:
                    This: 1
                    Input: 2
                    Here: 1
                    Capitalized: 1
                        ????????????γ???????????????????????????????20?м??????7?С?
                        ???????ù???????%wordlist???????????д???????±????????????????????????????????11??????????????keys()??????????????????????±??б??foreach????????б??????
                        ?????????????????????????????????keys()???????????????????????????κ????????????????????????????????????????????
                        ?????????????????????????????sort()??????keys()????????????У??磺
                    foreach $capword (sort keys(%wordlist)) {
                      print ("$capword: $wordlist{$capword}\n");
                    }
                    ?塢????????????
                        ????????????????????????飬?磺
                        %fruit = ("apples",17,"bananas",9,"oranges","none");
                        ???????????????麬??????????????
                  1. ?±??apples????????17
                  2. ?±??bananas????????9
                  3. ?±??oranges????????none
                  4.     ??????б?????????鴛????Perl5???????"=>"??","??????±????????"=>"????????Щ??????????Ч???
                        %fruit = ("apples"=>17,"bananas"=>9,"oranges"=>"none");
                    ??????????????????????????
                        ???б????????????????????????????????飬???????????????????????磺
                        @fruit = ("apples",17,"bananas",9,"oranges","none");
                        %fruit = @fruit;
                        ????????????????鴛????????????磺
                        %fruit = ("grapes",11,"lemons",27);
                        @fruit = %fruit;
                        ????????????????δ???壬??????????@fruit?????("grapes",11,"lemons",27)??("lemons",27,"grapes",11)??
                        ?????????????????????????磺%fruit2 = %fruit1; ?????????????????????Щ?????????????????????????磺
                        ($var1, $var2, %myarray) = @list;
                        ??????@list????????????$var1???????????$var2??????????%myarray??
                        ????????????????????????б?????????????????????????????????????а?split()??????????--????б?--????????????????????
                    1: #!/usr/local/bin/perl
                    2:
                    3: $inputline = <STDIN>;
                    4: $inputline =~ s/^\s+|\s+\n$//g;
                    5: %fruit = split(/\s+/, $inputline);
                    6: print ("Number of bananas: $fruit{\"bananas\"}\n");
                        ???н?????£?
                    oranges 5 apples 7 bananas 11 cherries 6
                    Number of bananas: 11
                    ??????????
                        ????????????????????????????δ?????????????????????????????????????$fruit{"lime"} = 1;?????±??lime????1????????
                        ?????????????????????delete???????????????????
                        delete ($fruit{"lime"});
                    ???
                    1?????????delete??????????????????????????Ψ????????
                    2???????????????????????????push??pop??shift??splice??????????λ??????????
                    ????г?????????????
                        ???????????keys()????????????????±???б???磺
                    %fruit = ("apples", 9,
                              "bananas", 23,
                              "cherries", 11);
                    @fruitsubs = keys(%fruits);
                    
                        ????@fruitsubs??????apples??bananas??cherries??????б???????????????б???д????????????????У??????sort()??????
                        @fruitindexes = sort keys(%fruits);
                        ????????("apples","bananas","cherries")???????????????values()???????????????б???磺
                    %fruit = ("apples", 9,
                               "bananas", 23,
                               "cherries", 11);
                    @fruitvalues = values(%fruits);
                    
                        ????@fruitvalues????????(9,23.11)?????????????
                    ????ù??????????
                        ???????????????keys()??????foreach?????????????Ч??????????????????±?????????????????磺
                    foreach $holder (keys(%records)){
                      $record = $records{$holder};
                    }
                        Perl????????Ч????????????????????each()???磺
                    %records = ("Maris", 61, "Aaron", 755, "Young", 511);
                    while (($holder, $record) = each(%records)) {
                      # stuff goes here
                    }
                        each()??????η????????????б?????????????±?????????????????????????????б??
                        ?????????each()????????????????????????????????????
                    ????ù??????鴴???????
                        ?ù???????????????????????????г?????????????????????????????????????????????
                    1??(??)????
                        ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
                        ??Perl?У???????????ù????????????????????????????????????????????????????????????е?????????
                    %words = ("abel", "baker", 
                              "baker", "charlie",
                              "charlie", "delta",
                              "delta", "");
                    $header = "abel";
                    
                        ?????У???????$header?????????е????????????????????????????????±????baker??????????????±??????????
                        ?±??delta????????????????????????????????
                        ????????????????δ?????????????ж???????????£???????????á?????????????????????????????е?????
                    1 : #!/usr/local/bin/perl
                    2 :
                    3 : # initialize list to empty
                    4 : $header = "";
                    5 : while ($line = <STDIN>) {
                    6 :   # remove leading and trailing spaces
                    7 :   $line =~ s/^\s+|\s+$//g;
                    8 :   @words = split(/\s+/, $line);
                    9 :   foreach $word (@words) {
                    10:     # remove closing punctuation, if any
                    11:     $word =~ s/[.,;:-]$//;
                    12:     # convert all words to lower case
                    13:     $word =~ tr/A-Z/a-z/;
                    14:     &add_word_to_list($word);
                    15:   }
                    16: }
                    17: &print_list;
                    18:
                    19: sub add_word_to_list {
                    20:   local($word) = @_;
                    21:   local($pointer);
                    22:
                    23:   # if list is empty, add first item
                    24:   if ($header eq "") {
                    25:     $header = $word;
                    26:     $wordlist{$word} = "";
                    27:     return;
                    28:   }
                    29:   # if word identical to first element in list,
                    30:   # do nothing
                    31:   return if ($header eq $word);
                    32:   # see whether word should be the new
                    33:   # first word in the list
                    34:   if ($header gt $word) {
                    35:     $wordlist{$word} = $header;
                    36:     $header = $word;
                    37:     return;
                    38:   }
                    39:   # find place where word belongs
                    40:   $pointer = $header;
                    41:   while ($wordlist{$pointer} ne "" &&
                    42:     $wordlist{$pointer} lt $word) {
                    43:     $pointer = $wordlist{$pointer};
                    44:   }
                    45:   # if word already seen, do nothing
                    46:   return if ($word eq $wordlist{$pointer});
                    47:   $wordlist{$word} = $wordlist{$pointer};
                    48:   $wordlist{$pointer} = $word;
                    49: }
                    50:
                    51: sub print_list {
                    52:   local ($pointer);
                    53:   print ("Words in this file:\n");
                    54:   $pointer = $header;
                    55:   while ($pointer ne "") {
                    56:     print ("$pointer\n");
                    57:     $pointer = $wordlist{$pointer};
                    58:   }
                    59: }
                        ???н?????£?
                    Here are some words.
                    Here are more words.
                    Here are still more words.
                    ^D
                    Words in this file:
                    are
                    here
                    more
                    some
                    still
                    words
                        ????????????????
                  5. ???????????????????????????
                  6. ?????add_word_to_list?????????????????
                  7. ?????print_list?????????????
                  8.     ??3~17???????????4?г??????????????????$header??????????5??????????ζ???????????7????????β??????8?н????????????9~15?е????????δ?????????????????????????????????????????????13?а??????????Сд???????14?д?????????add_word_to_list??
                        ?????add_word_to_list?????24?д???????????????????????25?н????????$header??26?д????????????????????????????%wordlist?С???????????37?м?????????????????????????????????????????????????????μ????????????????????????????????????$header???????????????
                        1????????????????±?????μ???????????????????
                        2?????μ??????$header??
                        ??????μ??????????????????40~44?????t??????$pointer???????????Чλ???41~44???????$wordlist{$pointer}????????$word??????????46?в??????????????????У???????????????47~48?н????????????С?????47?д????????$wordlist{$word}??????$wordlist{$pointer}?????$wordlist{$word}??$wordlist{$pointer}???????????????48?н?$wordlist{$pointer}??????$word??????$wordlist{$pointer}??????????????$wordlist{$word}??
                        ????????????????print_list()???????????????????$pointer????????????????$wordlist{$pointer}???????????????
                        ?????????????????????Щ????????sort()??keys()??????????????????????磺
                    foreach $word (sort keys(%wordlist)) {
                      # print the sorted list, or whatever }
                        ??????????漰?????????????????????к??????塣
                    2????
                        ????????????????(structure)???????????????????е???????????????????????????????????????
                        Perl???????????????????????????ù???????????????????C?????????μ????
                    struce{
                      int field1;
                      int field2;
                      int field3; }mystructvar;
                        ???????????????????????????????????飬?±????field1??field2??field3???磺
                    %mystructvar = ("field1" , "" ,
                          "field2" , "" ,
                          "field3" , "" ,);
                        ??????C????????????????????????%mystrctvar???????????±????field1??field2??field3??????????????????????????????????????±??????У??磺
                        $mystructvar{"field1"} = 17;
                    3????
                        ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
                        ??????????????????????????????????????????????????????????????
                        ????????????????????
                  9. ?????????????????????????/????????????/?????????????????/??????
                  10. ?????????????κν????????????????????
                  11. ??к??????????????????
                  12.     ?ж?????ù?????????????????????????????????????????????left??right???????????磬alphaleft??alpharight???alpha?????????????????????????????????????????????
                    1 : #!/usr/local/bin/perl
                    2 :
                    3 : $rootname = "parent";
                    4 : %tree = ("parentleft", "child1",
                    5 :          "parentright", "child2",
                    6 :          "child1left", "grandchild1",
                    7 :          "child1right", "grandchild2",
                    8 :          "child2left", "grandchild3",
                    9 :          "child2right", "grandchild4");
                    10: # traverse tree, printing its elements
                    11: &print_tree($rootname);
                    12:
                    13: sub print_tree {
                    14:   local ($nodename) = @_;
                    15:   local ($leftchildname, $rightchildname);
                    16:
                    17:   $leftchildname = $nodename . "left";
                    18:   $rightchildname = $nodename . "right";
                    19:   if ($tree{$leftchildname} ne "") {
                    20:     &print_tree($tree{$leftchildname});
                    21:   }
                    22:   print ("$nodename\n");
                    23:   if ($tree{$rightchildname} ne "") {
                    24:     &print_tree($tree{$rightchildname});
                    25:   }
                    26: }
                        ?????????£?
                    grandchild1
                    child1
                    grandchild2
                    parent
                    grandchild3
                    child2
                    grandchild4
                        ?ó???????????????????

                        ?????print_tree()????????????????????????????????????????????????????????????????????????22?????19????????????????????????????????????????????????????????????22?????25?к????????????????????????????????????????????
                        ????????????????????????????????±?????????????????????????????

                    ????? ????? ??


                    paper | appdir | ssv

                      <pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
                      <pre id="vvttv"></pre>

                        <p id="vvttv"></p>

                            <p id="vvttv"></p>

                                  <p id="vvttv"></p>

                                  <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                                    <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                                      <p id="vvttv"></p>

                                      这里只有精品视频