| Perl6-Pod documentation | view source | Contained in the Perl6-Pod distribution. |
create sub_context
return ref to hash of pod options per blockname
return ref to hash of plugin per formatcode name
return ref to hash of perl module per blockname
return ref to hash of user defined keys,vals
return ref to hash of Class optioons to create loaded by use mods
return ref to hash of pod options per blockname
Convert pod opt string to hash
Convert hash to opt string
'we' => {
'value' => '12 3 asdas a',
'type' => 'String'
}
Get options for block_type in current context
$c1->get_attr('item1');
=cut
sub get_attr { my $self = shift; my $btype = shift; return {} unless exists $self->config->{$btype}; my $hash = $self->_opt2hash( $self->config->{$btype} ); my %res = (); while ( my ( $key, $val ) = each %$hash ) { $res{$key} = $val->{value}; } return \%res; }
Set options for block_type in current context
$c1->set_attr('item1', { w=>[12] } );
=cut
#got array of attrs sub set_attr { my $self = shift; my $btype = shift;
#get current state
my $attr = shift;
my %par = ();
while ( my ( $key, $val ) = each %$attr ) {
$par{$key} = { value => $val };
}
my $opt = $self->_hash2opt(%par);
$self->config->{$btype} = $opt;
return $opt;
}
1; __END__
http://zag.ru/perl6-pod/S26.html, Perldoc Pod to HTML converter: http://zag.ru/perl6-pod/, Perl6::Pod::Lib
Zahatski Aliaksandr, <zag@cpan.org>
Copyright (C) 2009-2010 by Zahatski Aliaksandr
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| Perl6-Pod documentation | view source | Contained in the Perl6-Pod distribution. |