Hi,
I'm confronted with this problem.I've done this before but I just
can't remember how.
There is a log file I am trying to parse:
open FILE , 'C:\test.csv' or die $!;
while (<FILE>){
my ($logindate, $dbserver, $hostname, $status ) = split (/,/);
}
Now I want to use the $username as a name of a hash (sort of
dynamically create a variable.
So if in the end I want to print all the login records of let's say
user "James", I would have a report like this:
James
Login Date DBServer Hostname Login Status
Aug 5 mailserver mail.co.xx Success
Sep 3 dnsserver dns.co.xx failed
Aron
Login Date DBServer Hostname Login Status
Jan 5 ftpserver ftp.co.xx Success
Oct 3 sshserver ssh.co.xx Success
I'm really lost here. I know I have to use some sort of nested hashes
but I just couldn't figure it out.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/