How can I rid a Deprecated REF problem?

I

Ian Pellew

Hi All;

Why am I getting the perl -W complaint like:-
[Thu Nov 18 22:44:07 2004] w: Using a hash as a reference is
deprecated at w line 435.
. . . . .

from the likes of :-
435: my $en = \%$t_xmlin->{$child}->{$tag_s};

The process works OK, but I doubt I am future proof.

I am after a REF to the XML::Simple structure like:-
$VAR1 = {
'our_tags' => {
'idx_serno' => '10001',
'serno' => {
-> 'pt_' => {
'atts' => '1',
'edate' => '9912312359',
. . . . .

I go on to use $en like
my $l_var = eval{$$en->{$comp_to}};

Regards
Ian
 
E

Eric Amick

Hi All;

Why am I getting the perl -W complaint like:-
[Thu Nov 18 22:44:07 2004] w: Using a hash as a reference is
deprecated at w line 435.
. . . . .

from the likes of :-
435: my $en = \%$t_xmlin->{$child}->{$tag_s};

The process works OK, but I doubt I am future proof.

I am after a REF to the XML::Simple structure like:-
$VAR1 = {
'our_tags' => {
'idx_serno' => '10001',
'serno' => {
-> 'pt_' => {
'atts' => '1',
'edate' => '9912312359',
. . . . .

I think you really want

my $en = $t_xmlin->{$child}->{$tag_s};

The value is already a reference to a hash, if I understand you
correctly. It would be useful to show the values of $child and $tag_s.
 
A

Anno Siegel

Ian Pellew said:
Hi All;

Why am I getting the perl -W complaint like:-
[Thu Nov 18 22:44:07 2004] w: Using a hash as a reference is
deprecated at w line 435.
. . . . .

from the likes of :-
435: my $en = \%$t_xmlin->{$child}->{$tag_s};

Precedence -- the expression is parsed as

\ ( %$t_xmlin->{$child}->{$tag_s});

which gives you a scalar ref (and the warning).

I'm not sure why you think you need all this de-referencing and
referencing.

my $en = $t_xmlin->{$child}->{$tag_s};

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top