perl5-dbi / anydata Goto Github PK
View Code? Open in Web Editor NEWAnyData - easy access to data in many formats
License: Other
AnyData - easy access to data in many formats
License: Other
README FILE FOR PERL MODULE -- AnyData WHY USE IT? The AnyData modules provide simple and uniform access to data from many sources -- perl arrays, local files, remote files retrievable via http or ftp -- and in many formats including flat files (CSV, Fixed Length, Tab Delimited, etc), standard format files (Web Logs, Passwd files, etc.), structured files (XML, HTML Tables) and binary files with parseable headers (mp3s, jpgs, pngs, etc). There are two separate modules, each providing a different interface: AnyData.pm provides a simple tied hash interface and DBD::AnyData provides a DBI/SQL interface. You can use either or both depending on your needs. Here are a few examples of the tied hash interface: # FIND A USER'S HOME DIRECTORY IN A PASSWD FILE # my $users = adTie( 'Passwd', '/etc/passwd' ); print $users->{jdoe}->{homedir}; # DELETE A PLAYER FROM A PIPE DELIMITED GAMES DATABASE # my $players = adTie( 'Pipe', 'games.db', 'u' ); delete $players->{jdoe}; # RECURSIVELY LIST THE ARTISTS FOR ALL REGGAE MP3s # IN A SPECIFIED DIRECTORY TREE # my $music = adTie( 'Mp3', ['c:/My Music/'] ); while ( my $song = each %$music ) { print $song->{artist},"\n" if $song->{genre} eq 'Reggae'; } # RETRIEVE A CSV FILE FROM AN FTP SERVER # AND PRINT IT TO THE SCREEN AS AN HTML TABLE # # print adConvert( 'CSV', 'ftp://foo.edu/pub/bar.csv', 'HTMLtable' ); # COUNT THE NUMBER OF HITS FOR A SPECIFIED PAGE IN A WEB LOG # my $hits = adTie( 'Weblog', 'access.log'); print adCount( $hits , request => 'mypage.html' ); # CREATE A CGI POP-UP MENU FROM A LISTING # OF THE VALUES OF A TABLE COLUMN # my $game = adTie( 'Pipe','games.db' ); my @players = adColumn( $game, 'player' ); print CGI::popup_menu( 'players', \@players ); # SELECT OR MODIFY MULTIPLE ROWS BASED ON COMPLEX CRITERIA # (this deletes all North American males over age 30) # my $data = adTie( 'Tab', 'mydb.tab'); delete $data->{{ country => qr/us|mx|ca/, gender => 'eq m', age => '> 30', }}; WHAT ELSE DO I NEED? * Perl * Additional modules are required for some advanced features, see 'perldoc AnyData'. HOW DO I INSTALL IT? 1. Install Perl if not already installed 2. Unpack the compressed files. (AnyData-version.tar.gz or AnyData-version.zip) 3a. If you are not familiar with the standard Perl makefile method, you can simply copy the files 3b. If you are familiar with the standard Perl make installation, just do as always (perl Makefile.PL; make; make test; make install) this should also work with dmake or nmake. HOW DO I USE IT? First you might like to try this simple script which creates a database and inserts the string "hello new world" into a record and then retrieves the record and prints it: #!perl -w use strict; use AnyData; my $table = adTie ('CSV','test.db','o',{cols=>'id,phrase'}); $table->{1} = {phrase=>'hello new world'}; print $table->{1}->{phrase}. WHERE CAN I GET MORE INFO? After installing the module, type "perldoc AnyData" at the command prompt, or just read the documentation at the bottom of the AnyData.pm file. WHO DUNNIT? Jeff Zucker <[email protected]> Feel free to email me comments and suggestions, but please post questions requiring a response to the comp.lang.perl.modules newsgroup. READ MORE AND GRAB THE MODULE AT http://www.vpservices.com/jeff/programs/AnyData/ Enjoy!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.