in reply to Re: Re: Re: Sad newbie question about Data::Dumper and array references..
in thread Sad newbie question about Data::Dumper and array references..

Actually, @{$data}[0] and $data->[0] perform slightly different tasks. The former creates an array containing one element (hence the @ at the start), whilst the latter creates a scalar (hence the $ at the start).

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Sad newbie question about Data::Dumper and array references..
by greenFox (Vicar) on Mar 23, 2001 at 16:01 UTC
    hmmmm, which means I should have written-

    ${$data}[0]

    :-)

    --
    my $chainsaw = 'Perl';

      $$data[0]
      would suffice. However while style may be the only reason to prefer one over the other, in this case style aids comprehension. I far prefer seeing:
      $data->[0]
      all day.