in reply to read the file and assign each line to a hash????
You mean, other than using Email::Simple?
#!/usr/bin/perl use strict; use warnings; open my FILE, '<', $ARGV[0] or die "Can't read $ARGV[0]: $!"; my %header; while (<FILE>) { chomp; # trim trailing newline my ($k, $v) = split(': ', $_, 2); $header{$k} = $v; } # now $header{To} eq 'san<sanjay@36.212.176.07>' &etc.
|
|---|