CPAN Parser: Improvements Over Python
March 19, 2026 ยท View on GitHub
Summary
Rust improves on the Python reference in several practical ways:
- โจ Real parsing: stub-only CPAN metadata handlers become real parsers
- ๐ Safer fallback identity: malformed or unreadable inputs can still preserve parser identity instead of collapsing into generic package data
- ๐ Fuller metadata: package metadata, dependency scopes, author data, resource URLs, and manifest file references are extracted from real inputs
Reference limitation
The Python reference can detect several CPAN metadata files, but the core CPAN handlers are stub-oriented. That means files can be recognized without yielding meaningful package metadata.
Rust improvement
Rust performs real parsing for the main CPAN metadata surfaces:
META.json
Rust extracts package metadata, structured resource URLs, author information, license fields, and nested dependency scopes from modern CPAN metadata.
META.yml
Rust supports the older YAML metadata surface while preserving the dependency scopes and resource fields that matter for package consumers.
MANIFEST
Rust turns MANIFEST entries into structured file_references, which helps preserve what files the package claims as part of its source distribution.
Fallback identity hardening
When a CPAN input is malformed or unreadable, Rust still preserves the parser's package identity surface, including package_type, datasource_id, and primary_language, instead of losing those signals during fallback handling.
Why this matters
- Better Perl package visibility: CPAN metadata files now produce real package records instead of mostly empty placeholders
- Clearer dependency semantics: runtime, build, test, and configure scopes remain visible
- Safer scanner behavior: malformed inputs do not silently lose the identity needed for assembly and downstream interpretation