File::VirtualPath 1.011 |
Date Added: February 04, 2010 | Visits: 774 |
|
||||||||
File::VirtualPath is a portable abstraction of a file/dir/url path. SYNOPSIS Content of thin shell "startup.pl": #!/usr/bin/perl use strict; use warnings; my $root = "/home/johndoe/projects/aardvark"; my $separator = "/"; if( $^O =~ /Win/i ) { $root = "c:projectsaardvark"; $separator = ""; } if( $^O =~ /Mac/i ) { $root = "Documents:projects:aardvark"; $separator = ":"; } use Aardvark; Aardvark->main( File::VirtualPath->new( $root, $separator ) ); 1; Content of fat main program "Aardvark.pm" package Aardvark; use strict; use warnings; use File::VirtualPath; sub main { my (undef, $project_dir) = @_; my $prefs = ≥t_prefs( $project_dir->child_path_obj( config.pl ) ); &do_work( $prefs, $project_dir ); } sub get_prefs { my ($project_dir) = @_; my $real_filename = $project_dir->physical_path_string(); my $prefs = do $real_filename; defined( $prefs ) or do { my $virtual_fn = $project_dir->path_string(); die "Cant get Aardvark prefs from file $virtual_fn: $!"; }; return( $prefs ); } sub do_work { my ($prefs, $project_dir) = @_; my ($lbl_a, $lbl_b, $lbl_c) = ($prefs->{a}, $prefs->{b}, $prefs->{c}); my $data_source = $prefs->{sourcefile}; open( SOURCE, $project_dir->physical_child_path_string( $data_source ) ); while( my $line = ) { my ($a, $b, $c) = split( "t", $line ); print "File contains: $lbl_a=$a, $lbl_b=$b, $lbl_c=$cn"; } close( SOURCE ); } 1; Content of settings file "config.pl" $rh_prefs = { sourcefile => mydata.txt, a => name, b => phone, c => date, };.
|
License: Freeware | Size: 14.34 KB |
Programming
-
NLPP-Native Language Programming Project 70
NLPP (The Native Language Programming Project) aims to permit foreign programmers to program using commands (such as if) in their own language (such as 'si' for Spanish). We also aim to create an easily extensible program so that programmers all... |
328.15 KB | |
Programming
-
Python Genetic Programming Project 0.02
The Python Genetic Programming Project implements a Genetic Programming System a la J Koza in Python. |
8.24 KB | |
Programming
-
The Jscheme Web Programming Project 7.2
In this project we aim to develop scheme libraries for developingvarious web applications (especially servlets and xml-based web services). Our approach is to use jscheme (an open source implementation of scheme in Java) as the core language which... |
601.74 KB | |
Games
-
The EDGE Project 1.35
The EDGE project is a programming project to develop a DOOMtm style engine aimed at the Total Conversion developer, but still able to play the original DOOM games. This project started with the DOOM source released by Id Software. |
2.05 MB | |
Utilities
-
ggivnc 0.3.0
ggivnc project is a VNC client using libraries from the GGI project to draw graphics and handle input. The reason this VNC client came about was to fill the need for a companion to the VNC target in libggi. All existing VNC code was at the time... |
368.64 KB | |
Programming
-
devkitPro 1.5.7
This project is for homebrew console development tools based on the gnu compiler collection with additional tools and libraries to aid programming each supported console. The windows variants are built with MinGW. |
444.26 KB | |
Programming
-
iProcessing 8
Spaces within the path to the project folder can result in build errors (e.g. "error: SomeFile.h: No such file or directory"). If you are having problems building your project check that there are no spaces in the project path. |
99.85 MB | |
Arcade Style Games
-
Ball Game 1.0
My CS1P free programming project. A simple 2D ball game. Written in Python 2.x |
1.58 MB | |
Programming
-
Ouobpo 0.1
This is a useful Java libraries/frameworks & code samples project provided by Ouobpo. Ouobpo stands for Ouvroir de Objet Potentielle, or a workshop of potential objects. |
24.16 KB | |
Libraries
-
The Freiburg Project 2.0
The Freiburg project is an infrastructure to replace shared libraries with a client/server interface. This system converts a shared library into a "service" using Unix or inet domain sockets for communication. The "service" will be usable by any... |
204.8 KB |
Programming
-
Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations. |
471.04 KB | |
Programming
-
Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions. |
30.72 KB | |
Programming
-
Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned... |
30.72 KB | |
Programming
-
logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant... |
174.08 KB | |
Programming
-
OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a... |
3.83 MB | |
Libraries
-
wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating... |
3.88 MB | |
Libraries
-
EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented... |
10.68 MB | |
Libraries
-
Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable. |
5.35 KB | |
Libraries
-
Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;... |
8.19 KB | |
Libraries
-
sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also... |
10.24 KB |