>I'm almost embarrassed to say that this makes perfect sense.

no need to be embarrassed.. there's a big difference between recognizing
something that works, and getting it working in the first place.   it takes
hard work to make something look easy.


>When the geek
>toxicity reaches dangerous levels, I'll let you know.

*grin*  try this.. the object-oriented version:

package Login;

%PERM_LUT = (
    '1', 'database',
    '2', 'table',
    '3', 'search',
    '4', 'edit',
    '5', 'delete',
);

sub new {
    my $self = bless {}, shift;
    return $self;
}


sub get_permissions {
    my $self = shift;

    my @list  = $self->permissions();
    my $reply = undef;

    if (@list) {
        $reply = "<p> " . join ("\n<p> ", @PERM_LUT{ @list });
    } else {
        $reply = "no access permissions allows for this user."
    }
    return $reply;
}


sub permissions {
    return ();
}


package Admin;
@ISA = qw( Login );

sub permissions {
    return (1,2,3,4,5);
}



package User;
@ISA = qw( Login );

sub permissions {
    return (1,2,3);
}



package main;

$usr1 = new Admin;
$usr2 = new User;

print $usr1->get_permissions(), "\n\n";
print $usr2->get_permissions(), "\n\n";



>You, otoh, must be like a
>snake handler, immune from the rabid bite of the nefarious geek.

i'm grateful you chose to put me on the receiving end of the venom.. there
are people who'd say in no uncertain terms that i bite.  ;-)






mike stone  <[EMAIL PROTECTED]>   'net geek..
been there, done that,  have network, will travel.



____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to