s***k 发帖数: 23 | 1 【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: stock (Microsoft is dead), 信区: Programming
标 题: Perl for programmers(2): Assignment of variables
发信站: The unknown SPACE (Tue May 23 14:59:26 2000) WWW-POST
$n=43;
$n1=4.3;
$n2=4.3e12;
$str="djfk";
$str1="n is $n.";
Note: Use single quote unless you want to interpret some
variables
$str2='n is 43.';
$n2=$n1*$n;
@arr=("1","2","3","4");
($n1,$n2,$n3,$n4)=@arr;
$arr[0]="1";
sort @arr; #output ("1","2","3","4");
$arr1="0","7";
sort @arr,@arr1; #output ("0","1"," |
|