Click here to get back home

Module namespace: Tie::Flatfile::Array

 HomeNewsGroups | Search

comp.lang.perl.modules - Discussion about PERL modules 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Module namespace: Tie::Flatfile::Array Mumia W. 02-25-2007
Posted by Mumia W. on February 25, 2007, 11:55 pm
Please log in for more thread options



I'm creating a module called Tie::Flatfile::Array. The module will allow
the user to treat a "database" flat-file as an array of arrays. This is
how my new module might be used:

#!/usr/bin/perl
use strict;
use warnings;
use Tie::Flatfile::Array;
use Fcntl;

my $packformat = 'A30N';

tie my @db, 'Tie::Flatfile::Array', 'my.flat',
O_RDWR | O_CREAT, 0644, $packformat
or die("tie failed: $!");

push @db, ['yahoo.com', 3461];
push @db, ['lycos.com', 1449];
push @db, ['search.go.com', 960];

local $" = "\t";
print "@{[ qw(SearchDomain Hits) ]}\n";

for my $ix (0..$#db) {
print "@\n";
}


untie @db;

__END__

The $packformat specifies that each record will contain thirty ascii
characters followed by an integer in network byte-order (A30N). I think
the appropriate namespace for this module is Tie::Flatfile::Array¹. What
do you people think about the namespace and the module?

----------------------
¹ A Tie::Flatfile::Hash may or may not be coming too.

--
Windows Vista and your freedom in conflict:
http://techdirt.com/articles/20061019/102225.shtml


Similar ThreadsPosted
Tie::FlatFile::Hash : visualize a flatfile database as a hash of arrays March 7, 2009, 7:35 pm
Module to convert a list of xy points into an array (raster form) September 10, 2009, 5:50 pm
TL1 module namespace May 12, 2005, 1:13 pm
A module looking for a namespace March 4, 2005, 11:15 pm
New module namespace May 17, 2006, 8:38 pm
New Module Namespace December 20, 2008, 8:44 am
Module namespace query July 23, 2004, 12:36 pm
ANNOUNCE: Set::Array V 0.13 April 9, 2006, 12:25 am
ANNOUNCE: Set::Array V 0.14 April 10, 2006, 6:11 am
How to get an OLE array of objects? August 17, 2006, 6:33 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy