#!/usr/bin/perl @file = `ls /var/log/accounts`; foreach $file { open(FILE, "<$file") || die; @account=; close(FILE); foreach $account { ($username, $domain, $email, $service) = split(/,/, $account); # # Insert rest of my code here # } unlink $file; }