加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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.

?

  1. 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]$

?

  1. Rand()
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]$ ?

?

  1. Chr()
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!”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读