a LINUX perl question


o/s -- linux
language: perl

Suppose Im managing a free email account system , How to find out the last accessed time/date of a pop3 account ?

I want to delete account based on INACTIVITY ?

Which files to check ?

How to go about doing this in PERL ?

CAn you give me a web address where I can get more knowledge ?

Give me a hint atleast ?

christopher sagayamAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

HenryVermeulenConnect With a Mentor Commented:
The file to check is the users mailbox.
You can find it in /var/spool/mail
or /var/spool/vmail if you use vpop3.
You can only use the modified date of this file. That means that the date will be updated when a message is send to the account or the mail has been deliverred. (Then the size will be zero)
perl has a function the check tha modification date. It's called 'stat'.

if (-s $file = stat(X))  {
# your code
X can be 8 or 9

8 atime last access time since the epoch
9 mtime last modify time since the epoch

Straight from the user manual.

All Courses

From novice to tech pro — start learning today.