Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dist::metadata::struct(3pm) [debian man page]

Dist::Metadata::Struct(3pm)				User Contributed Perl Documentation			       Dist::Metadata::Struct(3pm)

NAME
Dist::Metadata::Struct - Enable Dist::Metadata for a data structure VERSION
version 0.923 SYNOPSIS
my $dm = Dist::Metadata->new(struct => { files => { 'lib/Mod.pm' => 'package Mod; sub something { ... }', 'README' => 'this is a fake dist, useful for testing', } }); DESCRIPTION
This 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. METHODS
new $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. AUTHOR
Randy Stauner <rwstauner@cpan.org> COPYRIGHT AND LICENSE
This 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)

Check Out this Related Man Page

Dist::Metadata::Dir(3pm)				User Contributed Perl Documentation				  Dist::Metadata::Dir(3pm)

NAME
Dist::Metadata::Dir - Enable Dist::Metadata for a directory VERSION
version 0.923 SYNOPSIS
my $dm = Dist::Metadata->new(dir => $path_to_dir); DESCRIPTION
This is a subclass of Dist::Metadata::Dist to enable getting the dists metadata from a directory. This can be useful if you already have a dist extracted into a directory. It's probably not very useful on it's own though, and should be used from "new" in Dist::Metadata. METHODS
new $dist = Dist::Metadata::Struct->new(dir => $path); Accepts a single 'dir' argument that should be a path to a directory. determine_name_and_version Attempts to parse name and version from directory name. dir Returns the "dir" attribute specified in the constructor. file_content Returns the content for the specified file. find_files Returns a list of the file names beneath the directory (relative to the directory). physical_directory Returns the "dir" attribute since this is already a directory containing the desired files. AUTHOR
Randy Stauner <rwstauner@cpan.org> COPYRIGHT AND LICENSE
This 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::Dir(3pm)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

Struct Initialization

Hi We are using a code generator for initializing structures with the #define macro. Compiling it with the GCC 2.8.1 (with -ansi) it OK. But when we are using the SUN C 5.0 compiler it screams. Following is a code sample: #include <stdlib.h> #include <stdio.h> typedef struct TEST3 {... (4 Replies)
Discussion started by: amatsaka
4 Replies

2. Programming

Finding Average for BST

Helo guys, this is not specifically a C programming problem for the unix platform, but a problem i came across in class: Find the average for a binary search tree: typedef Struct SNode { double value; SNode *leftChild; SNode *rightChild; } as SNode; /* * Solution 1 */ ... (2 Replies)
Discussion started by: heljy
2 Replies

3. Programming

Mod

I try to use mod(a,b) in a program but i cant Please help me (2 Replies)
Discussion started by: iwbasts
2 Replies

4. Shell Programming and Scripting

can't get perl Class::Struct to work

This is my code: #!/usr/bin/perl -w use strict; use Class::Struct; struct App => { name => '$', }; sub App::name { my $self = shift; if( @_ ) { $self->{'name'} = shift; } return $self->{'name'}; (3 Replies)
Discussion started by: IMTheNachoMan
3 Replies

5. Shell Programming and Scripting

Help with replace column one content based on reference file

Input file 1 testing 10 20 1 A testing 20 40 1 3 testing 23 232 2 1 testing 10 243 2 . . Reference file 1 final 3 used . . Output file (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Programming

Perl 2 files compares

What do i need to do have the below perl program load 205 million record files into the hash. It currently works on smaller files, but not working on huge files. Any idea what i need to do to modify to make it work with huge files: #!/usr/bin/perl $ot1=$ARGV; $ot2=$ARGV; open(mfileot1,... (2 Replies)
Discussion started by: mrn6430
2 Replies

7. Programming

Concatenating Struct Value With Char In C

After googling everything I could, the best I could do with this is get the following warning with -Wall: gcc -Wall help.c -o help help.c: In function ‘findpid': help.c:29:25: warning: passing argument 2 of ‘strncat' from incompatible pointer type strncat( pro, &str, 60); ... (5 Replies)
Discussion started by: Azrael
5 Replies