<div>hi everyone:</div>
<div>&nbsp;</div>
<div>&nbsp; 有一个小问题请教各位弟兄,是关于split函数的。</div>
<div>&nbsp; 我要把一个字串分成两个字段,以'|'为分隔符,程序应该是:</div>
<div>&nbsp; @a = split /\|/','item_code|store_code';</div>
<div>&nbsp; print join(&quot;\n&quot;,@a);</div>
<div>&nbsp;</div>
<div>&nbsp; 出来的结果是:</div>
<div>&nbsp; item_code</div>
<div>&nbsp; store_code</div>
<div>&nbsp; 而我将程序改为:</div>
<div>
<div>&nbsp; @a = split &quot;|&quot;,'item_code|store_code';&nbsp;&nbsp; #把"|"改成&quot;\|&quot; 也一样</div>
<div>&nbsp; print join(&quot;\n&quot;,@a);</div></div>
<div>&nbsp; 出来的结果是:</div>
<div>&nbsp; i</div>
<div>&nbsp; t</div>
<div>&nbsp; e</div>
<div>&nbsp; m</div>
<div>&nbsp; -</div>
<div>&nbsp; c</div>
<div>&nbsp; o</div>
<div>&nbsp; d</div>
<div>&nbsp; e</div>
<div>&nbsp; |</div>
<div>&nbsp; s</div>
<div>&nbsp; t</div>
<div>&nbsp; o</div>
<div>&nbsp; r</div>
<div>&nbsp; e</div>
<div>&nbsp; -</div>
<div>&nbsp; c</div>
<div>&nbsp; o</div>
<div>&nbsp; d</div>
<div>&nbsp; e</div>
<div>&nbsp;</div>
<div>不知有哪位弟兄能指点一下,split中//和&quot;&quot;的不同?<br clear="all"><br>-- <br>真理使你自由 </div>