1. Toby Inkster
  2. p5-data-dumper-declare

Commits

Toby Inkster  committed 5e13f5e Draft

cope better with weird stuff

  • Participants
  • Parent commits 2707cf0
  • Branches default

Comments (0)

Files changed (1)

File lib/Data/Dumper/Declare.pm

View file
 		my $parser = shift;
 		
 		my $args  = $parser->extract_args;
-		my $doc   = PPI::Document->new(\$args);
-		my $list  = $doc->find_first('Statement');
+		my $doc   = PPI::Document->new(\$args)
+			or Carp::croak("could not parse argument list");
+		my $list  = $doc->find_first('Statement')
+			or return;
 		
 		my @items;
 		my $pos = 0;