On Thu, Sep 26, 2002 at 09:38:18PM -0300, Bruno Negrao - Perl List wrote: > Hi,
Hi Bruno, > I'm triyng to open the /etc/aliases.db file for reading with the dbmopen > function - the result is that I can't open the file for reading, or > something like this. yes, I have permission because I'm root. > > My script is: > #!/usr/bin/perl -w > use diagnostics; > dbmopen(%ALIAS,'/etc/aliases',undef) || > die "No aliases!: $!"; > while (($key,$value) = each(%ALIAS)) { > chop($key,$value); > print "$key $value\n"; > } Disclaimer: I've never messed around with dbmopen() before, so I can't test this example, but seeing as nobody with more authority has answered this yet, I'll give it a shot: dbmopen() expects a file permission mask (an octal number) as its third argument, which 'undef' is not. You might try something like this as your lines 3 and 4: dbmopen(%ALIAS,'/etc/aliases', 0644) || die "No aliases!: $!"; Even if you're sure /etc/aliases is there, that should make dbmopen() happy. Again, not sure if that's the answer, but it seems logical to me, -- Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]