[plug] Re: [OT] Perl Array/List/Hash Question

Timothy White weirdo at tigris.org
Tue Feb 8 16:27:08 WST 2005


Timothy White wrote:

> Basically I am attempting to implement a mini database in perl.
> It goes like this, read in file in colon delimited format.
> Use split to split it into components
> Using the username component create a new 'database' entry with user
> data.
> modify database.
> write database back out.
>
> The bit I am having problems with is storing the database.
> I have tried
> $database{$username}->{'passwd'} = 'random';
> and that appears to work except I can't write it out again.
> foreach $user ($database){}
> doesn't return anything.
>
> I basically need to iterate through the database recovering all values
> as well as the changes.

Oh. And it has to be simple, generic perl so that I can take it to any
machine and have it work without getting modules from CPAN...

Tim

--
Tim White - Use the Fox, Luke!
PGP/GPG id: 602E944D, Pub Key Serv: subkeys.pgp.net
Fingerprint: 04C2 9682 B7B2 3006 009D  A9F3 067E EDCD 602E 944D
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
--

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20050208/73b650d2/attachment.pgp>


More information about the plug mailing list