Name : perl-Acme-Include-Data
| |
Version : 0.05
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 1.61
| Date : 2024-08-05 18:25:06
|
Group : Development/Libraries/Perl
| Source RPM : perl-Acme-Include-Data-0.05-1.61.src.rpm
|
Size : 0.01 MB
| |
Packager : (none)
| |
Summary : How to Include Data Files with a Cpan Module
|
Description :
This is a demonstration module which demonstrates how to include a data file with a Perl module and how to read it in at run time.
If you are a CPAN author or use the CPAN-style tools to distribute your data, you may have wondered how to include data with your Perl distribution.
Any file under lib in the distribution is bundled into the distribution by _Makefile.PL_. So if your distribution is called _Acme::Include::Data_, then a file called _lib/Acme/Include/this-is-a-data-file.txt_ is automatically included into the distribution.
To read the data file in, simply use __FILE__:
my $data = __FILE__;
$data =~ s/Data\\.pm$/this-is-a-data-file.txt/;
open my $in, \"< \", $data or die $!; my $text = \'\'; while (< $in>) { $text .= $_; }
(This example is included as at https://api.metacpan.org/source/BKB/Acme-Include-Data-0.05/examples/read-da ta.pl in the distribution.)
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-A/openSUSE_Tumbleweed/noarch |