Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How can I rid a Deprecated REF problem?

Reply
Thread Tools

How can I rid a Deprecated REF problem?

 
 
Ian Pellew
Guest
Posts: n/a
 
      11-22-2004
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
 
Reply With Quote
 
 
 
 
Eric Amick
Guest
Posts: n/a
 
      11-23-2004
On 22 Nov 2004 15:58:01 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) (Ian Pellew)
wrote:

>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.

--
Eric Amick
Columbia, MD
 
Reply With Quote
 
 
 
 
Anno Siegel
Guest
Posts: n/a
 
      11-23-2004
Ian Pellew <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 22 04-30-2008 10:42 AM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 6 04-29-2008 08:09 AM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 0 04-24-2008 08:23 PM
Deprecated warnings within deprecated code Barney Barumba Java 0 07-23-2003 12:46 AM



Advertisments