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

perl 学习陆续记载

发布时间:2020-12-15 23:59:56 所属栏目:大数据 来源:网络整理
导读:perl标示符概览 本文主要对学习perl过程进行记载,方便后期学习 #!/usr/bin/perl# This is a single line commentprint "Hello,worldn";=begin comment注释块,以=开始, 以=cut结束This is all part of multiline comment.You can use as many lines as yo

perl标示符概览

本文主要对学习perl过程进行记载,方便后期学习

#!/usr/bin/perl
# This is a single line comment

print "Hello,worldn";

=begin comment
注释块,以=开始, 以=cut结束
This is all part of multiline comment.
You can use as many lines as you like
These comments will be ignored by the 
compiler until the next =cut is encountered.
=cut


1.双引号能解释当中引用的变量,单引号不会打印出变量值

2.为escape特殊符号

3.perl标示符标示变量,方法名,类名,模块名和其他对象。perl标示符用$,@,%后接一个多多哥字符,下划线以及数字(0-9)


perl变量

perl为宽松类型语言,大致有三种类型1. 标量 $ 2. 数组@ 3 Hashes %

数字分为有符号整型态以及双精度浮点数,另外还有字符串,同时要注意字符串中的backslash的特殊字符,列表如下所示意

Escape sequence Meaning
Backslash
' Single quote
" Double quote
a Alert or bell
b Backspace
f Form feed
n Newline
r Carriage return
t Horizontal tab
v Vertical tab
0nn Creates Octal formatted numbers
xnn Creates Hexideciamal formatted numbers
cX Control characters,x may be any character
u Force next character to uppercase
l Force next character to lowercase
U Force all following characters to uppercase
L Force all following characters to lowercase
Q Backslash all following non-alphanumeric characters
E End U,L,or Q

(编辑:李大同)

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

    推荐文章
      热点阅读