Example of hash in Perl
来源:互联网 发布:用友易代账软件 编辑:程序博客网 时间:2024/05/29 12:39
#!/usr/bin/perl -wuse strict;use warnings;my %name=("fred"=>"flintstone","barney"=>"rubble", "wilma"=>"flintstone", );my $length=keys %name;# Count the number of hashprint "$length\n";while(my($k,$v)=each%name)# List all the elements of hash{print "$k---->$v\n";}my $given_name=<STDIN>;# The Usage of <STDIN>chomp $given_name;# Delete the "\n"print "$name{$given_name}\n";
output:
3
barney---->rubble
wilma---->flintstone
fred---->flintstone
fred
flintstone
- Example of hash in Perl
- Usage of hash in Perl
- An Example of Perl Multi-thread 2
- Usage of Array in Perl
- perl example!
- Perl example
- Perl example
- Example Of has_many In Rails's ActiveRecord
- Python example of SSH in multi-threads
- Enlightening Example of Naming Federation in JNDI
- Example of a SysTray App in Win32
- example of using ajax in VisualForce page
- example of using ActionFunction in Salesforce
- Example of Unix commands implemented in Java
- Example of @EnableAsync and @Async in Spring
- A Simple Example of Dynamic Programming using perl scripts
- Perl (hash)
- perl hash
- 己所不欲勿施于人,怎么能反对远嫁?
- SessionFactory.getCurrentSession与openSession的区别
- C++ 用libcurl库进行http通讯网络编程
- IplImage结构
- Windows Server 2008 R2 服务器安装(重装)流程备忘
- Example of hash in Perl
- 安卓学习--------spinner控件
- 0917
- 用JNI从C传递结构体到JAVA
- android 实现定时拍照功能
- WebSphere启动was出错:server1 注册成作为 Windows 服务运行
- 14条建议,使你的IT职业生涯更上一层楼
- 选择TTL和CMOS混合电路时需要注意的一些问题
- 在CentOS5.4下安装SVN