]> git.donarmstrong.com Git - perltidy.git/blobdiff - examples/perltidyrc_dump.pl
Imported Upstream version 20130922
[perltidy.git] / examples / perltidyrc_dump.pl
index 4ec2115a9a8da44b9076519d333e9e42449944e2..8c598cf5121ffa4a03909d1d22a7c77c15a58b0f 100644 (file)
@@ -262,7 +262,7 @@ sub read_perltidyrc {
     my $empty_file = "";    # this will be our .perltidyrc file
     my %Opts_default;       # this will receive the default options hash
     my %abbreviations_default;
-    Perl::Tidy::perltidy(
+    my $err = Perl::Tidy::perltidy(
         perltidyrc         => \$empty_file,
         dump_options       => \%Opts_default,
         dump_options_type  => 'full',                  # 'full' gives everything
@@ -270,6 +270,9 @@ sub read_perltidyrc {
         stderr             => \$stderr,
         argv               => \$argv,
     );
+    if ($err) {
+        die "Error calling perltidy\n";
+    }
 
     # now we call with a .perltidyrc file to get its parameters
     my %Getopt_flags;