Re: Anonymous Reference Question



On Sep 28, Dave Adams said:

#!/usr/bin/perl -w
use strict;
use Data::Dumper;
my $grades = {"tom"=> 50, "sally"=> 60, "harry" => 70};
print Dumper($grades) ;

And perl gives me this:

$VAR1 = {
         'harry' => 70,
         'sally' => 60,
         'tom' => 50
       };

QUESTION: Does this mean that $grades is an anonymous reference
because perl gives is $VAR1?

No, it's just what Data::Dumper outputs when you don't assign a name to the data structure you pass it. See the Data::Dumper docs.


--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart
.



Relevant Pages

  • Re: [:alpha:]
    ... It seems that my perl does not understand the ... posix syntax. ... RPI Acacia Brother #734 % the cheated, ... http://www.perlmonks.org/ % have long ago been overpaid? ...
    (perl.beginners)
  • Re: catchDate
    ... Perl provides a date function, localtime ... RPI Acacia Brother #734 % the cheated, we who for every service http://japhy.perlmonk.org/ % have long ago been overpaid? ...
    (perl.beginners)
  • Re: Sorting HTML tables
    ... On Aug 4, Perl said: ... There's no reason to chomp() here, and besides, chompdoesn't return the ... RPI Acacia Brother #734 ... http://japhy.perlmonk.org/ % have long ago been overpaid? ...
    (perl.beginners)
  • Re: regex variable matching when its more than variable
    ... Richard Lee wrote: ... Let's say I want to go through the array to see if $var1 exists and also to see if it followed by _ and then 4 digits ... $ perl -le' ...
    (perl.beginners)
  • RE: regular expression match question
    ... a perfectly acceptable outcome. ... The regex got a match at the left-most ... RPI Acacia Brother #734 ... http://japhy.perlmonk.org/ % have long ago been overpaid? ...
    (perl.beginners)