Re: Hash of Array Does Not Return What I expect

2008-04-05 Thread Chas. Owens
On Fri, Apr 4, 2008 at 12:16 PM, Rascal <[EMAIL PROTECTED]> wrote: > I am using Perl 5.8.5 on Red Hat Linux. > > The output of the following script: > > #!/usr/bin/perl -w > @array = [0, 1, 2, 3]; snip This is creating an array with one element. The element is a reference to an array that hold

Re: hash of array does not return what I expect

2008-04-05 Thread Robert (bloo)
> The output of the following script: > > #!/usr/bin/perl -w > @array = [0, 1, 2, 3]; > $hash{0} = @array; > print "array = @array\n"; > print "hash = ", $hash{0}, "\n"; > > is: > > array = ARRAY(0x8d13c20) > hash = 1 > > I expected the results to be the same. Why aren't they? First thi

Re: hash of array does not return what I expect

2008-04-05 Thread Dr.Ruud
Rascal schreef: > The output of the following script: > > #!/usr/bin/perl -w > @array = [0, 1, 2, 3]; > $hash{0} = @array; > print "array = @array\n"; > print "hash = ", $hash{0}, "\n"; > > is: > > array = ARRAY(0x8d13c20) > hash = 1 > > I expected the results to be the same. Why aren't they?