in reply to (jeffa) 2Re: Detecting Expired User Accounts
in thread Detecting Expired User Accounts
This may be flavour dependent, but in my experience expire is usually in epoch seconds, so in addition to testing for truth (to see if the account has an expire time) you need to also compare against time().
use strict; use User::pwent; while ( my $user = getpwent ) { if ( $user->expire && $user->expire <= time ) { printf "%s expired (%s)\n", $user->name, scalar(localtime($user->expire)); } }
--k.
|
|---|