perl functions
发布时间:2020-12-15 20:54:46 所属栏目:大数据 来源:网络整理
导读:Start learning Perl scripts,record some useful Perl functions here. ? Int() Function int() can return a integer from a float value. [user@host perl]$ perl -e "print int(1.6)" 1[user@host perl]$ perl -e "print int(2.6)" 2[user@host perl]$ ?
Start learning Perl scripts,record some useful Perl functions here.
?
Function int() can return a integer from a float value.
[user@host perl]$ perl -e "print int(1.6)"
1[user@host perl]$ perl -e "print int(2.6)"
2[user@host perl]$
?
Function rand() can return a radon value between 0 and a certain integer.
[user@host perl]$ perl -e "print int(rand(20))"
5[user@host perl]$
?perl -e "print int(rand(20))"
7[user@host perl]$ perl -e "print int(rand(20))"
15[user@host perl]$
?perl -e "print int(rand(20))"
7[user@host perl]$
?
?
Function chr() can return a character of keyboard from a number.
[user@host perl]$
?perl -e "print chr(48)"
0[user@host perl]$
?perl -e "print chr(43)"
+ [user@host perl]$
?perl -e "print chr(37)"
%[user@host perl]$
?
?
These are simple functions,I’ll collect more in future. I always remember the sentence “Thousands of miles are beginning form our feet!”
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |