Click here to get back home

Module namespace: Tie::Flatfile::Array

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   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
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
Module namespace query July 23, 2004, 12:36 pm
Namespace for new module: HTML::Template::HTX? May 13, 2005, 7:17 pm
Namespace for Z-machine parse/translate module July 29, 2004, 10:02 am
Choosing a good namespace for a module to upload to CPAN July 14, 2004, 1:46 pm
Namespace Recommendation for Abuse Reporting Utilities Module February 26, 2006, 10:53 pm
Scary module base namespace proposal: Metaweb August 16, 2007, 5:51 pm
ANNOUNCE: Set::Array V 0.13 April 9, 2006, 12:25 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap