Programming Perl 2
来源:互联网 发布:dbtg数据库 编辑:程序博客网 时间:2024/05/16 01:17
1。VariablesConstruct Meaning Construct Meaning Construct Meaning
There are variable types corresponding to each of the three data types we mentioned. Each of these is introduced (grammatically speaking) by what we call a "funny character". Scalar variables are always named with an initial $
, even when referring to a scalar that is part of an array or hash. It works a bit like the English word "the". Thus, we have:
$days
Simple scalar value $days
$days[28]
29th element of array @days
$days{'Feb'}
"Feb
" value from hash %days
$#days
Last index of array @days
$days->[28]
29th element of array pointed to by reference $days
$#days-1 means the last second index
Entire arrays or array slices (and also slices of hashes) are named with @
, which works much like the words "these" or "those":
@days
Same as ($days[0], $days[1],... $days[n])
@days[3, 4, 5]
Same as ($days[3], $days[4], $days[5])
@days[3..5]
Same as ($days[3], $days[4], $days[5])
@days{'Jan','Feb'}
Same as ($days{'Jan'},$days{'Feb'})
Entire hashes are named by %
:
%days
(Jan => 31, Feb => $leap ? 29 : 28, ...)
- Programming Perl 2
- 《Advandced Perl Programming》第七章、POE(2)
- Perl Programming Language
- Programming Perl 1
- Advanced Perl Programming
- Perl Database Programming
- Perl Programming for Biologists
- Advanced Perl Programming 读书笔记
- Programming Perl--Column1
- Programming Perl----------Column1
- PLEAC-Perl 教程 - CGI Programming (Perl进阶者极力推荐)
- Chapter 5 Using Perl for CGI Programming
- A thread_safe perl closure programming model
- Oracle Programming with Perl DBI / DBD
- 《Advandced Perl Programming》第七章、POE(1)
- Perl programming with DB2 Universal Database
- Perl Hacks : Tips & Tools for Programming, Debugging, and Surviving
- 第二十七章 Introduction to Perl Programming(中文版)
- 偶然开博
- 《struts2权威指南》学习笔记之struts2文件上传--使用fileUpload拦截器
- linux 下gdb命令一览表
- 回到开发岗位,重新开始使用CSDN
- 实战 Lucene,第 1 部分: 初识 Lucene
- Programming Perl 2
- HTTPS 协议下东东的下载
- c#中资源文件的使用
- CEO、COO、CFO、CTO是什么意思
- 休假结束了
- Study Flex
- JavaScript代码收集
- isa 2004 配置代理服务器服务
- DataGrid数据另存为