1. $string = join(" ","this","is","a","string"); 
  2. @list = ("words","and"); 
  3. @string = join("::","@list","color");    
  4. print "@string\n";   #words and::color 
  5. @string = join("::",@list,"color"); 
  6. print "@string\n";   #words::and::color 
  7. @array = split(/::/,$string); 
  8. print "@string\n"; #words::and::color 


 

  1. 匹配输入 
  2. my $string = "25abc8"
  3. $string =~ /abc/; 
  4. $matched = $&;  #  $&当前匹配值  
  5. print  $matched ; 
  1. perl 子函数传入参数 
  2.  
  3. sub sub1{ 
  4.     my($number1, $number2, $number3) = @_;  # 必须用 @_ 
  5.     ... 
  6.   }