Query: dist::metadata::struct
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Dist::Metadata::Struct(3pm) User Contributed Perl Documentation Dist::Metadata::Struct(3pm)NAMEDist::Metadata::Struct - Enable Dist::Metadata for a data structureVERSIONversion 0.923SYNOPSISmy $dm = Dist::Metadata->new(struct => { files => { 'lib/Mod.pm' => 'package Mod; sub something { ... }', 'README' => 'this is a fake dist, useful for testing', } });DESCRIPTIONThis is a subclass of Dist::Metadata::Dist to enable mocking up a dist from perl data structures. This is mostly used for testing but might be useful if you already have an in-memory representation of a dist that you'd like to examine. It's probably not very useful on it's own though, and should be used from "new" in Dist::Metadata.METHODSnew $dist = Dist::Metadata::Struct->new(files => { 'lib/Mod.pm' => 'package Mod; sub something { ... }', }); Accepts a "files" parameter that should be a hash of "{ name => content, }". Content can be a string, a reference to a string, or an IO object. default_file_spec "Unix" is the default for consistency/simplicity but "file_spec" can be overridden in the constructor. file_content Returns the string content for the specified name. find_files Returns the keys of the "files" hash.AUTHORRandy Stauner <rwstauner@cpan.org>COPYRIGHT AND LICENSEThis software is copyright (c) 2011 by Randy Stauner. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-19 Dist::Metadata::Struct(3pm)