File: create.pl

package info (click to toggle)
pam 1.7.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,268 kB
  • sloc: ansic: 36,301; xml: 21,687; perl: 972; sh: 836; yacc: 412; lex: 64; makefile: 56; python: 21
file content (21 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
# this program creates a database in ARGV[1] from pairs given on
# stdandard input
#
# $Id$

use DB_File;

my $database = $ARGV[0];
die "Use: create.pl <database>\n" unless ($database);
print "Using database: $database\n";

my %lusers = ();

tie %lusers, 'DB_File', $database, O_RDWR|O_CREAT, 0644, $DB_HASH ;
while (<STDIN>) {
  my ($user, $pass) = split;

  $lusers{$user} = $pass;
}
untie %lusers;