www.perl.com
Perl Programming
Dereferencing Data
  • Dereferencing yields the data
    • Appropriate symbol dereferences original data
    • Arrow operator (->) dereferences items

        my @fruit = qw(apple banana cherry);
        my $fruitref = \@fruit;

        print "I have these fruits: @$fruitref.\n";
        print "I want a $fruitref->[1].\n";
      

        I have these fruits: apple banana cherry.
        I want a banana.
      
Previous http://stuff.mit.edu/iap/perl/