Any login or shell trick should be done from within the shell.
Nor from within Perl. And any trick, barring things that block
him from doing anything at all (like putting an "exec /bin/false" in the top of his .rc file) can be easily defeated, usually by just doing a 'mv ~/.shellrc ~/.nananarc'
and relogging in.
Of course you better not play stupid tricks this way on any
box I admin. Accounts are not to be shared. And if I need
to spend time fixing someone's account, that time will be
charged to the budget of your department/group/section whatever.
Abigail