sub parse_file { my ($class, $file) = @_; local $/; open my $f, $file or croak $!; my $data = <$f>; return $class->parse($data); } =head2 parse Creates a C object from a string. =cut sub parse { my ($class, $data) = @_; my @lines = split /\n/, $data; my $type = shift @lines; croak "Can only handle bank accounts right now, not type $type" unless $type eq "!Type:Bank";