Or does { @_ } create an annoymous hash from the elements of the argument array and if so, how does that => $class fit in?
The braces here create a reference to an anonymous hash. The curly braces are probably the most overloaded symbols in Perl. Sometimes the usage is even ambiguous and perl doesn't do what you would expect.
=> is essentially the same as a comma except that sometimes you don't need to quote what's on the left side of it (which isn't relevant here).
You could also write this as:
sub new {
my $class = shift;
my %self = @_;
bless \%self, $class;
}
or
sub new {
my $class = shift;
my $self = { @_ };
bless $self, $class;
}