in reply to Reference Example

You have to It's better if you dereference the ref outside the quotes :) and ofcourse do it properly
print "The value of \$fer is ",%{$fer},"\n"; print "The value for the key \"mickey\" is ",${$fer}{'mickey'},"\n";
There's ofcourse always Perl's Data Structures Cookbook.

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Reference Example
by lachoy (Parson) on May 20, 2002 at 16:11 UTC

    Nitpicky time: one of the reasons for Perl's line-noise rep is lines like:

    print "The value for the key \"mickey\" is ",${$fer}{'mickey'},"\n";
    Using qq instead of the double-quotes and the arrow as the dereferencing operator, you'd get (IMO) a much cleaner:
    print qq(The value for the key "mickey" is $fer->{mickey}\n);

    Chris
    M-x auto-bs-mode

      Actually, the escaped double quotes were there in the root node. Since the question was about references, I didn't bother to edit THAT part :)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.