perl标示符概览
本文主要对学习perl过程进行记载,方便后期学习
#!/usr/bin/perl# This is a single line commentprint "Hello,world\n";=begin comment注释块,以=开始, 以=cut结束This is all part of multiline comment.You can use as many lines as you likeThese 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 | |
Creates Octal formatted numbers | nn\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 |
以上是内存溢出为你收集整理的perl 学习陆续记载全部内容,希望文章能够帮你解决perl 学习陆续记载所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)