From:                   [EMAIL PROTECTED]
> I want to store  a hash into an array: e.g.: like this
> 
> #!/usr/bin/perl -v
> 
> print "Content-type: text/html\n\n";
> 
> $h{'hello'}="hello";

This accesses the hash named %h.

> $h{'by'}="by";
> $a[0]=$h;

This accesses the scalar named $h.

Those two are NOT related.

You should start your scripts with

 use strict;
 use warnings;

to be shielded from this kind of errors.

In this case if you want the $a[0] to contain a reference to the hash 
%h, you have to do it like this:

$a[0] = \%h;

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to