use strict; use IO::File; use File::stat; my $fh = new IO::File 'radius.log', O_RDONLY or die $!; my $st = stat($fh) or die $!; my $len = $st->[7]; my $data; read $fh, $data, $len; my @lines = split /\n/, $data; foreach my $line(@lines){ $line =~ /^(\w+\s+\w+\s+\d+\s+\d{2}:\d{2}:\d{2}\s+\d{4})\s+:\s+(\w+):(.*):\s+\[(.*)\]\s+\((.*)\)$/; #printf "Date => %s, Auth => $2, Mesg => $3, MAC/X => $4, Client => $5\n", $1, $2, $3, $4, $5; printf "Client: %s\n", $5; }