pax_global_header 0000666 0000000 0000000 00000000064 11635444061 0014516 g ustar 00root root 0000000 0000000 52 comment=54d684f07781d7ad36475887f94cd82d319f8af1 perl-Data-Section-Simple-0.03/ 0000755 0000000 0000000 00000000000 11635444061 0016100 5 ustar 00root root 0000000 0000000 perl-Data-Section-Simple-0.03/.gitignore 0000644 0000000 0000000 00000000045 11635444061 0020067 0 ustar 00root root 0000000 0000000 META.yml Makefile inc/ pm_to_blib *~ perl-Data-Section-Simple-0.03/.shipit 0000644 0000000 0000000 00000000165 11635444061 0017403 0 ustar 00root root 0000000 0000000 steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN git.push_to = origin perl-Data-Section-Simple-0.03/Changes 0000644 0000000 0000000 00000000727 11635444061 0017401 0 ustar 00root root 0000000 0000000 Revision history for Perl extension Data::Section::Simple 0.03 Sun Sep 18 12:35:54 PDT 2011 - Noted the use of utf8 pragma - Doc typo fixes (Util) 0.02 Thu Mar 18 15:14:44 PDT 2010 - Added a warning document about __DATA__ appearing elsewhere (rjbs) - Fixed a bug installing via cpanm often fails because fileno $d could be 0 when STDIN is closed (reported by rjbs) 0.01 Thu Mar 18 01:06:44 2010 - original version perl-Data-Section-Simple-0.03/MANIFEST 0000644 0000000 0000000 00000000734 11635444061 0017235 0 ustar 00root root 0000000 0000000 .gitignore Changes inc/Module/Install.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/ReadmeFromPod.pm inc/Module/Install/Repository.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/Data/Section/Simple.pm Makefile.PL MANIFEST This list of files META.yml README t/00_compile.t t/basic.t t/data.t t/DataInCode.pm t/Foo.pm t/pkg_oo.t xt/pod.t perl-Data-Section-Simple-0.03/MANIFEST.SKIP 0000644 0000000 0000000 00000000173 11635444061 0017777 0 ustar 00root root 0000000 0000000 \bRCS\b \bCVS\b \.svn/ \.git/ ^MANIFEST\. ^Makefile$ ~$ \.old$ ^blib/ ^pm_to_blib ^MakeMaker-\d \.gz$ \.cvsignore \.shipit perl-Data-Section-Simple-0.03/Makefile.PL 0000644 0000000 0000000 00000000320 11635444061 0020045 0 ustar 00root root 0000000 0000000 use inc::Module::Install; all_from 'lib/Data/Section/Simple.pm'; readme_from('lib/Data/Section/Simple.pm'); build_requires 'Test::More', 0.88; test_requires 'Test::Requires'; auto_set_repository(); WriteAll; perl-Data-Section-Simple-0.03/README 0000644 0000000 0000000 00000005105 11635444061 0016761 0 ustar 00root root 0000000 0000000 NAME Data::Section::Simple - Read data from __DATA__ SYNOPSIS 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
Hello @@ bar.tt [% IF true %] Foo [% END %] DESCRIPTION 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. BUGS __DATA__ appearing elsewhere If you data section has literal "__DATA__" in the data section, this module might be tricked by that. Although since its pattern match is greedy, "__DATA__" appearing *before* the actual data section (i.e. in the code) might be okay. This is by design -- in theory you can "tell" the DATA handle before reading it, but then reloading the data section of the file (handy for developing inline templates with PSGI web applications) would fail because the pos would be changed. If you don't like this design, again, use the superior Data::Section. utf8 pragma If you enable utf8 pragma in the caller's package (or the package you're inspecting with the OO interface), the data retrieved via "get_data_section" is decoded, but otherwise undecoded. There's no reliable way for this module to programmatically know whether utf8 pragma is enabled or not: it's your responsibility to handle them correctly. AUTHOR Tatsuhiko Miyagawa