use Data::Section::Simple qw(get_data_section); # Functional interface -- reads from caller package __DATA__ my $all = get_data_section; # All data in hash reference my $foo = get_data_section('foo.html'); # OO - allows reading from other packages my $reader = Data::Section::Simple->new($package); my $all = $reader->get_data_section; __DATA__ @@ foo.html <html> <body>Hello</body> </html> @@ bar.tt [% IF true %] Foo [% END %]
Overview
Data::Section::Simple is a simple module to extract data from "__DATA__" section of the file.
Limitations
As the name suggests, this module is a simpler version of the excellent Data::Section. If you want more functionalities such as merging data sections or changing header patterns, use Data::Section instead.
This module does not implement caching (yet) which means in every "get_data_section" or "get_data_section($name)" this module seeks and re-reads the data section. If you want to avoid doing so for the better performance, you should implement caching in your own caller code.
Releases
7 releases since Debian 7 (Wheezy); the text changed 3 times.