Irssi::Script::InfoParser - Extract information from the $VERSION and %IRSSI headers of an Irssi script.
$VERSION
%IRSSI
version 0.004
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};
Tom Feist <shabble+cpan@metavore.org>
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.
To install Irssi::Script::InfoParser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Irssi::Script::InfoParser
CPAN shell
perl -MCPAN -e shell install Irssi::Script::InfoParser
For more information on module installation, please visit the detailed CPAN module installation guide.