Skip to content

Instantly share code, notes, and snippets.

@moznion
Last active December 15, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moznion/5261898 to your computer and use it in GitHub Desktop.
Save moznion/5261898 to your computer and use it in GitHub Desktop.
requires 'App::cpanminus' => '1.6008';
requires 'JSON' => '2.53';
requires 'Furl' => '2.10';
_requires 'List::Util' => 0;
on 'configure' => sub {
requires 'Module::Build' => '0.40';
requires 'Module::Build' => '0.09';
};
on 'build' => sub {
requires 'Test::More' => '0.98';
};
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.012000;
use Module::CPANfile;
my $file = $ARGV[0];
my $parser = Module::CPANfile->load($file);
my $res = $parser->parse();
@moznion
Copy link
Author

moznion commented Mar 28, 2013

$ perl parse_cpanfile.pl ./cpanfile

I expect the above command will output

Parsing /foo/bar/cpanfile failed: syntax error at (eval 1) line 4, near "_requires 'List::Util'"

however it outputs

Parsing /foo/bar/cpanfile failed: syntax error at (eval 1) line 9, near "_requires 'List::Util'"

It inform us that error line number that is increased 5 lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment