Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2653650
  • 博文数量: 416
  • 博客积分: 10220
  • 博客等级: 上将
  • 技术积分: 4193
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-15 09:47
文章分类

全部博文(416)

文章存档

2022年(1)

2021年(1)

2020年(1)

2019年(5)

2018年(7)

2017年(6)

2016年(7)

2015年(11)

2014年(1)

2012年(5)

2011年(7)

2010年(35)

2009年(64)

2008年(48)

2007年(177)

2006年(40)

我的朋友

分类:

2008-04-03 13:47:27

#!/usr/bin/perl
use strict;
use Getopt::Long;
use Pod::Usage;
use File::Copy;
use Data::Dumper;
use Cwd;
use DBI;
use Encode;
use File::BOM qw( :all );
my $hashVer = {};
my $hashV = {'A'=>1,'B'=>2,'C'=>3};
%{$hashVer} = %{$hashV} ;
################################
# $hashVer = $hashV; 注意它们的不同
################################

print Dumper($hashV);
$hashVer->{'A2'}=5;
print Dumper($hashV);
if (%$hashV){
 print "Empty\n"; 
}
阅读(1603) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-04-03 14:19:34

二级COPY my $hashVer = {}; my $hashV = {'A'=>[1,'a'],'B'=>[2,'b'],'C'=>[3,'c']}; #%{$hashVer} = %{$hashV}; foreach my $key (keys(%$hashV)){ @{$hashVer->{$key}} = \@{$hashV->{$key}} ; } #$hashVer = $hashV ; print Dumper($hashV); $hashVer->{'A'}[0]=5; print Dumper($hashV);