The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Irssi::Script::InfoParser - Extract information from the $VERSION and %IRSSI headers of an Irssi script.

VERSION

version 0.004

SYNOPSIS

    use Irssi::Script::InfoParser;

    my $parser = Irssi::Script::InfoParser->new(file => $script);
    my $version = $parser->version;

    my @fields = $parser->metadata_fields;
    my $metadata = $parser->metadata;

    foreach my $name (@fields) {
        say "Value is $metadata->{$name}!";
    }

or

    # assuming the authors field is actually defined.

    my $parser = Irssi::Script::InfoParser->new(file => $script,
                                                split_authors => 0);

    return unless $parser->has_field('authors');

    my $authors_string = $parser->metadata->{authors};

    my $parser = Irssi::Script::InfoParser->new(file => $script,
                                                split_authors => 1);

    my $authors_arrayref = $parser->metadata->{authors};

AUTHOR

Tom Feist <shabble+cpan@metavore.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Tom Feist.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.