in reply to Re^2: Printing accessor methods in here documents
in thread Printing accessor methods in here documents

The [] creates a reference to a list. The @{ } dereferences that list, so you get basically the same thing you've put in it (kind of).

The trick here is: inside a string, @{[ ]} gets whatever is inside it to be evaluated as an array.

Your first version was having $self being parsed all by itself (try opening your code with Vim, having syntax on; Vim's syntax will catch that for you).

And don't forget to use strict. And probably to create an account here, too, so we can all say "welcome" :-)