Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: read the file and assign each line to a hash????

by radiantmatrix (Parson)
on Sep 08, 2006 at 14:50 UTC ( [id://571978]=note: print w/replies, xml ) Need Help??


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.
<radiant.matrix>
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://571978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found