perl中shift 和unshift 操作
来源:互联网 发布:企业名录采集软件 编辑:程序博客网 时间:2024/05/21 09:10
####################################################################
# unshift 和shift 对一个数组的开头进行操作(数组的左端有最小下标的元素)。
# unshift 和shift,如果其数组变量为空,则返回undef。
####################################################################
#!/usr/bin/perl -w# unshift 和shift 对一个数组的开头进行操作(数组的左端有最小下标的元素)。
# unshift 和shift,如果其数组变量为空,则返回undef。
####################################################################
@array = qw#one two three#;
$m = shift (@array); #$m 得到“one”, @array 现在为(“two”, “three”)
shift @array; #@array 现在为(“three”)
shift @array; #@array 现在为空
$n = shift @array; #$n 得到undef, @arry 仍为空
unshift(@array,5); #@array 现在为(5)
unshift @array,4; #@array 现在为(4,5)
@others = 1..3;
unshift @array, @others; #array 现在为(1,2,3,4,5)
- perl中shift 和unshift 操作
- perl中shift 和unshift 操作
- perl中shift 和unshift 操作
- 3 Perl - 列表赋值 - shift 和unshift 操作
- 【Perl读书笔记】数组操作push、pop、shift和unshift
- 操作Perl数组: shift, unshift, push, pop
- 操作Perl数组: shift, unshift, push, pop
- perl中的shift和unshift使用
- ActionScript中数组操作(一):push(pop)与unshift(shift)
- js中 数组的操作 push(),pop(),shift(),unshift() 简介
- JavaScript shift()和unshift()方法
- Perl学习(十三)——数组操作总结 push pop shift unshift
- 数组的操作push,pop,shift,unshift
- js中 push pop shift unshift方法
- 两个简单方法--shift()和unshift();
- Perl 数组应用详解(push, pop, shift, unshift)
- [乐意黎转载]JS中push()和pop()以及unshift()和shift()的用法小结
- Js数组的操作push,pop,shift,unshift等方法
- 李嘉诚:做老板还是做领袖
- 如何禁止对话框关闭按钮和浮动工具条上的系统菜单
- 请教关于基于C#移动考勤系统的开发。谢谢!!!
- 【转】装apache的时候如何集成modssl的问题
- 升级linux2.4.20内核到2.6.18
- perl中shift 和unshift 操作
- 未授予用户在此计算机上的请求登录类型
- NLS Information for Windows 7
- Csharp中的数组、集合、泛型集合
- java中ServerSocketChannel原理 清晰明了
- 找回GhostXP系统的Internet信息服IIS的方法和IIS的一些烦人的事
- 模式识别技术漫谈(2)
- Capture Key sequence in non-gui application(后台按键捕获) - [symbian]
- Word 提示对话框 PowerDesigner Cannot find the word template:wordtorqm.dot