Quote:
But in this case, if I want to have separate admin and user function, I have to duplicate the code, almost the same code (1-5% difference), except the admin has a few prints to display informational text on admin interface.I'm not sure what you are doing, but surely:
sub modify {
my $am_admin = shift;
# your code here
}
sub admin_modify {
modify(1);
}
sub user_modify {
modify(0);
}
could accomplish what you want.
Cheers,
Alex
--
Gossamer Threads Inc.