Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Error : Can't use a hash as a reference

by anjultyagi (Novice)
on Nov 21, 2018 at 12:16 UTC ( [id://1226123]=note: print w/replies, xml ) Need Help??


in reply to Re: Error : Can't use a hash as a reference
in thread Error : Can't use a hash as a reference

Hi Corion, when i run my code in perl 5.10 it gives me the results.
atyagi@qtspg-1 ~$ perl perlHash.pl
Using a hash as a reference is deprecated at perlHash.pl line 10.
Using a hash as a reference is deprecated at perlHash.pl line 11.
Using a hash as a reference is deprecated at perlHash.pl line 12.
1.1 after method call $VAR1 = 'claimList';
$VAR2 = undef;
$VAR3 = 'error';
$VAR4 = undef;
$VAR5 = 'contractList';
$VAR6 = '';

same code i am runing in 5.26.1 its give me an error.
Can't use a hash as a reference at perlHash.pl line 10.

#!/usr/bin/perl -w # use strict; use warnings; use Data::Dumper; my %rowRetrun; %rowRetrun->{'contractList'} = ""; %rowRetrun->{claimList} = (); %rowRetrun->{error} = (); print "1.1 after method call ", Dumper(%rowRetrun);

Replies are listed 'Best First'.
Re^3: Error : Can't use a hash as a reference
by Corion (Patriarch) on Nov 21, 2018 at 12:20 UTC

    Again: That's not how you access a hash.

    Maybe you want:

    $rowRetrun{ 'contractList' } = "";
      Thanks Corion. its working now.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1226123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found