File::ShareDir v.1.00


File::ShareDir is a Perl module that provides a companion to Class::Inspector and File::HomeDir, modules that take a process that is well-known by advanced Perl developers but gets a little tricky, and make it more available to the larger Perl community.Quite often you want or need your Perl module (CPAN or otherwise) to have access to a large amount of read-only data that is stored on the file-system at run-time.On a linux-like system, this would be in a place such as /usr/share, however Perl runs on a wide variety of different systems, and so the use of any one location is unreliable.Perl provides a little-known method for doing this, but almost nobody is aware that it exists. As a result, module authors often go through some very strange ways to make the data available to their code.The most common of these is to dump the data out to an enormous Perl data structure and save it into the module itself. The result are enormous multi-megabyte .pm files that chew up a lot of memory needlessly.Another method is to put the data "file" after the __DATA__ compiler tag and limit yourself to access as a filehandle.The problem to solve is really quite simple. 1. Write the data files to the system at install time. 2. Know where you put them at run-time.Perl's install system creates an "auto" directory for both every distribution and for every module file.These are used by a couple of different auto-loading systems to store code fragments generated at install time, and various other modules written by the Perl "ancient masters".But the same mechanism is available to any dist or module to store any sort of data.SYNOPSIS use File::SharedDir ':ALL'; # Where are distribution-level shared data files kept $dir = dist_dir('File-ShareDir'); # Where are module-level shared data files kept $dir = module_dir('File::ShareDir'); # Find a specific file in our dist/module shared dir $file = dist_file( 'File-ShareDir', 'file/name.txt'); $file = module_file('File::ShareDir', 'file/name.txt'); # Like module_file, but search up the inheritance tree $file = class_file( 'Foo::Bar', 'file/name.txt' );

File::ShareDir is a Perl module that provides ... Locate per-dist and per-module shared files ...

  • File::ShareDir
  • 1.00
  • Adam Kennedy
  • Linux
  • Freeware
  • 30 Kb
  • 199
  • Free

Review File::ShareDir

  • captcha

Other software of Adam Kennedy

New Miscellaneous software
  • SocialMedia driven App Developer  v.3.00If you could look 1 year ahead, would you want to see? The SocialMedia driven App Developer is calculating your Shareware's Success. Fine-tune as many cost-driving parameters as you want. See revenue and net profit results displayed over 48 months.
  • Excavator  v.1.0.11Diggernaut is a cloud based service for web scraping, data extraction and other ETL (Extract, Transform, Load) tasks. If you dont have any programming skills, you can use Excavator tool to build configuration for your scrapers.
  • InstallAware Free Installer  v.X6InstallAware's new Free Installer runs inside Visual Studio and creates setups automatically, by scanning your loaded solutions for dependencies and output files, and including them in your setup. This special edition of InstallAware is freeware!
  • Metamill  v.8.1.1921Metamill is a professional UML modeling tool. Supports UML 2.4 standard. All 14 UML diagrams supported. Round-trip engineering for Python, ADA, Java, C, C++, C# and VB.Net. RTF and HTML document generation.
  • Badger::Class  v.0.06Badger::Class is a class metaprogramming module.
  • Test-Run  v.0.0123Test::Run is an improved test harness, originally based on Test::Harness version 2.