in reply to Learning classes in Perl

Well, basically the error message tries to tell you that you forgot to define your package's constructor. You can name your constructors as you like, naming it new is a mere convention. And it is missing something like
sub new { return bless {}, __PACKAGE__; }
Of course, you could name your constructors differently, e.g. after defining
sub File { return bless {}, 'File'; }
you would use File->File instead of File->new.