use NestedListParser qw( ); sub load { my $self = shift; my $qfn = shift; open(my $fh, '<', $qfn) or croak("Couldn't open file \"$qfn\": $!"); my $file; { local $/; $file = <$fh>; } my $parser = NestedListParser->new(); $self->{list} = $parser->parse($file) or die("Bad data\n"); }