in reply to passing $_ to my function

You could try using the & form of a subroutine call:
for (keys %online_users) { if (policy_is_expired($_)) { &logoff_user; } }
This form passes @_ to the sub if no arguments are given.

Replies are listed 'Best First'.
Re^2: passing $_ to my function
by Aristotle (Chancellor) on Sep 30, 2002 at 13:03 UTC
    No, that won't work. You're passing @_, which is not the same as $_.

    Makeshifts last the longest.