on Tue, 25 Jun 2002 10:28:07 GMT, [EMAIL PROTECTED] (David Vd Geer Inhuur Tbv Iplib) wrote:
> Changed some stuff and have 2 questions open. > [code snipped] > 1) I don't like to die in my script as there are many files to > read. And if I can't open the current file I just want to > continue with the rest of the files So I always prefer printing. It would be better to use 'warn' instead of print > print "Invalid login"; exit unless $u{$pwuser} || $g{$group}; > > BUT, how do I combine a printing error message and an exit > within the unless ? Right now it always prints, and only exits > when I have no permissions. 'unless' here is used as a statement modifier, which means it only works on the 'exit'. You want to use: unless (...) { print; exit; } -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]