ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:33.27KB ,
资源ID:19437512      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19437512.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Perl的基本语法Perl的基本语法Word文档下载推荐.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Perl的基本语法Perl的基本语法Word文档下载推荐.docx

1、純量變數是Perl裡最基本的一種資料型態,它可以代表一個字元、字串、整數、甚至浮點數,而Perl把它們都看成是一樣的東東!你甚至可以混著用,不可思議吧。标量标量 是Perl里最基本的一种资料型态,它可以代表一个字元、字串、整数、甚至浮点数,而Perl把它们都看成是一样的东东!你甚至可以混着用,不可思议吧。 例如:例如:# 井字號開頭的後面都是註解。# 純量變數以$開頭。# my 是一種宣告變數的方式,它可以使變數區域化。# 宣告變數時若不加my 或local 則Perl會把它當作全域變數使用。# 習慣上,我們會將字串用雙引號括起來,而數值就不用加引號。my $x=abc;my $x=123;m

2、y $x=4.56;那麼程式怎麼判斷這是數值還是字串呢? 其實不是程式判斷,而是你自己要判斷。那么程式怎么判断这是数值还是字串呢?其实不是程式判断,而是你自己要判断。 Perl分別提供了一堆運算子來處理數字和字串,你必須知道這個變數是數值或字串,才能使用個別的運算子來對變數做運算。 Perl分别提供了一堆运算子来处理数字和字串,你必须知道这个变数是数值或字串,才能使用个别的运算子来对变数做运算。 我分別列出字串運算子和數值運算子,好讓大家能區分它們的不同。我分别列出字串运算子和数值运算子,好让大家能区分它们的不同。字串運算子 字串运算子 String Operator String Opera

3、tor Purpose Purpose x x Returns a string consisting of the string on the left of the operand, repeated the number of times of the right operand. Returns a string consisting of the string on the left of the operand, repeated the number of times of the right operand. Concatenates the two strings on bo

4、th sides of the operator. Concatenates the two strings on both sides of the operator. eq eq Returns True if the two operands are equivalent, False otherwise. Returns True if the two operands are equivalent, False otherwise. ne ne Returns True if the two operands are not equal, False otherwise. Retur

5、ns True if the two operands are not equal, False otherwise. le le Returns True if the operand on the left is stringwise less than the operand on the right of the operator. Returns False otherwise. Returns True if the operand on the left is stringwise less than the operand on the right of the operato

6、r. Returns False otherwise. lt lt Returns True if the operand on the left is stringwise less than or equal to the operand on the right of the operator. Returns False otherwise. Returns True if the operand on the left is stringwise less than or equal to the operand on the right of the operator. Retur

7、ns False otherwise. ge ge Returns True if the operand on the left is stringwise greater than or equal to the operand on the right of the operator. Returns False otherwise. Returns True if the operand on the left is stringwise greater than or equal to the operand on the right of the operator. Returns

8、 False otherwise. gt gt Returns True if the operand on the left is stringwise greater than the operand on the right of the operator. Returns False otherwise. Returns True if the operand on the left is stringwise greater than the operand on the right of the operator. Returns False otherwise. cmp cmp

9、Returns -1, 0, or 1 if the left operand is stringwise less than, equal to, or greater than the right operand. Returns -1, 0, or 1 if the left operand is stringwise less than, equal to, or greater than the right operand. , , Evaluates the left operand, the evaluates the right operand. It returns the

10、result of the right operand. Evaluates the left operand, the evaluates the right operand. It returns the result of the right operand. + + Increments the string by one alphabetic value. Increments the string by one alphabetic value. 數值運算子 数值运算子 Value Operator Value Operator + + Computes the additive

11、value of the two operands. Computes the additive value of the two operands. - - Computes the difference between the two operands. Computes the difference between the two operands. * * Computes the multiplication of the two operands. Computes the multiplication of the two operands. / / Computes the d

12、ivision between the two operands. Computes the division between the two operands. % % Computes the modulus(remainder) of the two operands. Computes the modulus(remainder) of the two operands. = = = = Returns Ture if the two operands are equivalent, False otherwise. Returns Ture if the two operands a

13、re equivalent, False otherwise. != != Returns Ture if the two operands are not equal, False otherwise. Returns Ture if the two operands are not equal, False otherwise. = =Returns Ture if the operand on the left is numerically greater than or equal to the operand on the right of the operator. Returns

14、 False otherwise. Returns Ture if the operand on the left is numerically greater than or equal to the operand on the right of the operator. Returns False otherwise. Returns Ture if the operand on the left is numerically greater than the operand on the right of the operator. Returns False otherwise.

15、Returns Ture if the operand on the left is numerically greater than the operand on the right of the operator. Returns False otherwise. = Returns -1 if the left operand is less than the right, +1 if is it greater than, and 0(False) otherwise. Returns -1 if the left operand is less than the right, +1

16、if is it greater than, and 0(False) otherwise. & &Performs a logical AND operation. If the left operand is True m then the right operator is not evaluated. Performs a logical AND operation. If the left operand is True m then the right operator is not evaluated. | | Performs a logical OR operation. I

17、f the left operand is True m then the right operator is not evaluated. Performs a logical OR operation. If the left operand is True m then the right operator is not evaluated. Returns the valueof the two operators bitwise ANDed. Returns the valueof the two operators bitwise ANDed. | | Returns the va

18、lueof the two operators bitwise ORed. Returns the valueof the two operators bitwise ORed. Returns the valueof the two operators bitwise XORed. Returns the valueof the two operators bitwise XORed. Increment operator. Increments the variables value by 1. Increment operator. Increments the variables va

19、lue by 1. - - Decrement operator. Decrements the variables value by 1. Decrement operator. Decrements the variable* * Computes the power of the left-hand value to the power of the rihght-hand value. Computes the power of the left-hand value to the power of the rihght-hand value. += += Adds the value

20、 of the right-hand operand to the value of the left-hand operand. Adds the value of the right-hand operand to the value of the left-hand operand. -+ -+ Subtracts the value of the right-hand operand to the value of the left-hand operand. Subtracts the value of the right-hand operand to the value of t

21、he left-hand operand. *= *= Mlutiplies the value of the left-hand operand to the value of the right-hand operand. Mlutiplies the value of the left-hand operand to the value of the right-hand operand. Shifts the left operand right by the number of bits that is specified by the right operand. Shifts t

22、he left operand right by the number of bits that is specified by the right operand. Shifts the left operand left by the number of bits that is specified by the right operand. Shifts the left operand left by the number of bits that is specified by the right operand. Performs a 1s complement of the op

23、erator. This is a unary operator. Performs a 1s complement of the operator. This is a unary operator. (b) Scalar Array: (b) Scalar Array:純量陣列,陣列內的每一個元素都是Scalar variable。纯量阵列,阵列内的每一个元素都是Scalar variable。 宣告及使用方式如下:宣告及使用方式如下:# 純量陣列以 開頭。my array;my array=qw(abcd);# qw 函數會將其後的每個元素用逗點隔開,效果就像下面這行。my array=(a,bcd);# 當然你也可以一個個元素宣告,下面就是存取每一個元素的方法。# 因為陣列中的每一個元素都是純量變數,所以要以$ 開頭, # 剛開始容易搞混,請注意。$array0= $array1= $array2= $array3=# 使用for loop印出陣列內每個元素的值。for($i=0; $i 這個符號是Perl5新增的,是為了相關陣列量身定做的, # 因為索引和元素值都是純量,若使用= 這個符號, # (索引=元素值) 兩兩對應,就不容易發生失誤。my %hash=(i1aaai2bbbi3ccc# 上面這行的效果和下面這行是一樣的。a

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1