You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by st...@btinternet.com on 2001/11/08 15:58:57 UTC

Can't use an undefined value as an ARRAY reference at /var/www/perl/addrts.htm

Hi

I am getting the error: "Can't use an undefined value as an ARRAY reference" on the following line:

$rkdd = &unpack_kisam_record('QG','rtsco',$udat{rtscos}[$fdat{rtscode}]);

However - if I insert the following lines of code in before this line it works:

foreach $key (keys %udat) {
        print "$key - $udat{$key}\n";
}       

Any ideas why this is/how to fix it?

Regards
Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Can't use an undefined value as an ARRAY reference at /var/www/perl/addrts.htm

Posted by Gerald Richter <ri...@ecos.de>.
Hi
>
> I am getting the error: "Can't use an undefined value as an ARRAY
reference" on the following line:
>
> $rkdd = &unpack_kisam_record('QG','rtsco',$udat{rtscos}[$fdat{rtscode}]);
>

Does it work when you rewrite it to

$rtscos = $udat{rtscos} ;
$rkdd = &unpack_kisam_record('QG','rtsco',$rtscos->[$fdat{rtscode}]);

I guess it will. There are some odd behaviours in the implementation of tied
hashs in Perl. Sometimes it's necessary to divide an operation in two steps.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org