sub import { my $self = shift; my %args = @_; $path = $args{path}; open(FILEREAD, "$path") or die "Cannot open $path for reading: $!\n"; read FILEREAD, $string, -s FILEREAD; close FILEREAD; @matches = $string =~ /\s.*\s.*\@.*\s/g; foreach (@matches) { if (/\s(.*)\s(.*\@.*)\s/) { $users{$1} = $2 } }