乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      腳本語(yǔ)言介紹——perl(2)

       mzsm 2022-06-22 發(fā)布于湖北

      本公眾號(hào)【讀芯樹(shù):duxinshu_PD】主要介紹數(shù)字集成電路物理設(shè)計(jì)相關(guān)知識(shí),才疏學(xué)淺,如有錯(cuò)誤,歡迎指正交流學(xué)習(xí)。

      是集成電路物理設(shè)計(jì)的第七個(gè)系列【腳本語(yǔ)言】的第十六篇文章,本篇文章主要介紹perl相關(guān)內(nèi)容

      01

      特殊字符

      print 'filename is: '__FILE__ .'\n';    #打印當(dāng)前文件名字print 'linenum is: '__LINE__ .'\n'; #打印當(dāng)前行行號(hào)print 'packagename is: '. __PACKAGE__ .'\n'#打印包文件

      02


      數(shù)組

      #數(shù)組以@開(kāi)頭@fruit=(apple, oriage, banana);print '$fruit[0]\n';        #打印apple@fruit[3]=peach;            #向數(shù)組添加元素@num=(0..9);                #定義數(shù)組0,1,2,...,9@alp=(a..z);                #定義數(shù)組a,b,c,...,zprint '@alp\n'              #打印數(shù)組print '@alp[4..8]'         #打印第4,5,6索引的數(shù)值,0_based  print '', scalar @alp, '\n' #數(shù)組大小$size=@alp;                 #數(shù)組物理大小,不是元素個(gè)數(shù)$max_index=$#alp;           #數(shù)組最大索引push(@arr,value);           #在arr結(jié)果加入valuepop(@arr);                  #刪除arr最后一個(gè)值shift(@arr);                #彈出第一個(gè)值unshit(@arr, value);        #在第一個(gè)位置加入value,順位后面所有元素splice(@arr, offset, length, newlist) #替換從offset開(kāi)始,長(zhǎng)度為length的數(shù)值為newlist@arr=split('-', '2022-05-18');        #將2022-05-18拆分為2022 05 18$str=join('/', @arr);                 #將2022 05 18合并為2022/05/18@arr=qw(3 1 5 2 3 6);@arr=sort(@arr);                      #排序$[=1;                                 #設(shè)置第一個(gè)索引值為1@str3=(1, 2, 3, (4, 5, 6));           #合并兩個(gè)數(shù)組@list=(a, b, c, d ,e, f, g)[3..5];    #輸出3 4 5的索引值d, e, f

      03


      hash

      hash是key:value對(duì)的集合,以%開(kāi)頭%week = ('1', 'Monday', '2', 'Tuesday', '3', 'Wednesday');%week = ('1'=>'Monday''2'=>'Tuesday''3'=>'Wednesday');print '\$week{'1'} = $week{'1'}\n';   @keys=keys %week;print '@keys\n'; #返回hash所有的keys@value=values %week;print '@value\n';   #返回hash所有的values
      if (exists($week{'3'})) {print '$week{'3'}'else {print 'no this keys'}@size=keys %week;$num=@size; #hash大小$week{'4'}='Thursday';   #添加新的keys:valuedelete $week{'3'};       #刪除keys的valueforeach $key (keys %week) {print '$week{$key}\n';}         #foreach循環(huán)while (($key$value)=each(%week)) {print '$week($key)\n'#while循環(huán)

      04


      條件語(yǔ)句

      #if-elseif (boolean_expression) {  body1}else {  body2}#if-elseif-elseif (boolean_expression) {  body1}elsif {  body2}else{  body3}#unlessunless (boolean_expression) {  body  #布爾表達(dá)式為非時(shí)執(zhí)行}#switchswitch (argument) {  case 1 {print '1'}  case a {print 'a'}  else   {print 'other'}}#三元運(yùn)算符$result={$a>10}? 'a > 10' : 'a <=10';  #$a>10,則選擇:左側(cè),否則選擇右側(cè)

      05


      循環(huán)

      #while循環(huán)$a=0;while ($a<10) { print '$a\n'; $a=$a+1;}#until循環(huán)$a=0;until ($a>9) { print '$a\n'; $a=$a+1;}#for循環(huán)for ($a=0; $a<10;$a=$a+1) { print '$a\n';}#foreach循環(huán)foreach $a (@list=(0..9)) { print '$a\n';}#do-while循環(huán)$a=0;do { print '$a\n'; $a=$a+1;while ($a<10)#next語(yǔ)句$a=0;while ($a<10) {    if {$a==5} {     $a=$a+1     next;    } print '$a\n'; $a=$a+1;}#last語(yǔ)句$a=0;while ($a<10) { if {$a==5} { $a=$a+1;         last; } print '$a\n'; $a=$a+1;}#continue語(yǔ)句$a=0;while ($a<10) { print '$a\n';} continue { $a=$a+1;}#redo語(yǔ)句$a = 0;while($a < 10){ if( $a == 5 ){ $a = $a + 1; redo; } print 'a = $a\n';}continue{ $a = $a + 1;}#goto語(yǔ)句$a = 0;LOOP:do{ if( $a == 5){ $a = $a + 1; goto LOOP; } print '$a\n'; $a = $a + 1;}while( $a < 10 );

      06


      參考文獻(xiàn)

      https://www.runoob.com/perl/perl-tutorial.htmlhttps://www.perl.org/

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多