>Uncaught exception from user code:
>        No aliases!: Invalid argument at ./zz line 3.

Well you have three arguments.  If you are *sure* that the undef is not the 
problem, that leaves only two to possibly be invalid.  To start, try battening 
down the hatches with use strict, predeclaring your vars with my.  Does using 
a hash NOT called ALIAS make a difference (the implication being maybe that is 
somehow a reserved identifier for hashes on your system or distro)?  Are you 
*sure* that the path specified in the dbmopen call is 100% correct?  Dumb, 
dumb questions but most problems in programming turn out to be really stupid, 
and it doesn't hurt to brainstorm and try anything.


>
>I must admit that the errors are shorter but the program still doesn't
>work!!
>Oh, hell!!!
>
>Thank you for any help,
>bnegrao.
>
>
>----- Original Message -----
>From: "Michael Kelly" <[EMAIL PROTECTED]>
>To: "Perl Beginners List" <[EMAIL PROTECTED]>
>Sent: Friday, September 27, 2002 1:04 AM
>Subject: Re: dbmopen can't open /etc/aliases.db file
>
>
>> 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]
>>
>>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to