[Chicago-talk] Deprecated use of hash as a reference

Joel Limardo joel.limardo at forwardphase.com
Thu Apr 8 12:32:18 PDT 2010


Can someone publish more of this code...I tried to emulate this by guessing
and came up with this:

-- snip --

#!/usr/bin/perl -w
use strict;
use Data::Dumper;

my %hash = ();
my @junk = qw|a b c d e f g|;

for(@junk)
{
    push @{{\%hash}->{'something'}},{id=>$_};
}
print Dumper %hash;

-- end snip --

This kicks out all kinds of errors:

Odd number of elements in anonymous hash at hashref.pl line 11.




On Thu, Apr 8, 2010 at 10:18 AM, imran javaid <imranjj at gmail.com> wrote:

> what if you had used the following?
> push @{%hash{$odate}}, {id => $id, ..
>
> -imran
>
> On Thu, Apr 8, 2010 at 9:42 AM, Brad Doty <bdoty at eqtc.com> wrote:
> > Speaking of PM as a source for assistance...
> >
> > I was just composing a note to ask you guys how to solve a pesky warning
> > in inherited code.  My fear of embarrassment in front of the entire
> > group made me review my terms more precisely, which suggested a
> > solution.  And it worked!
> >
> > So thanks, ChicagoPM, for helping me solve my problem.
> >
> > My solution is this
> >
> > 940c940
> > <old     push @{%hash->{$odate}}, {id => $id, ...
> > ---
> >>new     push @{{\%hash}->{$odate}}, {id => $id, ...
> >
> > Any critiques or better ideas to avoid using hash as a reference?
> >
> >
> > Thanks,
> >
> > Brad
> >
> >
> > _______________________________________________
> > Chicago-talk mailing list
> > Chicago-talk at pm.org
> > http://mail.pm.org/mailman/listinfo/chicago-talk
> >
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>



-- 
Sincerely,


Joel Limardo
Chief Software Engineer
ForwardPhase Technologies, LLC
401 N. Michigan Avenue
Suite 1200-10
Chicago, IL 60611
www.forwardphase.com
joel.limardo at forwardphase.com
LinkedIn: http://www.linkedin.com/in/joellimardo
Twitter: http://twitter.com/joellimardo
Fax: 815-346-9495
Ph : 877-321-5467
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20100408/314d36ea/attachment.html>


More information about the Chicago-talk mailing list