lacertus has asked for the wisdom of the Perl Monks concerning the following question:
Can you see my problem? It lays in the fact that I have to open and close the filehandle containing the message to start at the beginning of the file for each mail send. Otherwise, only the first message has content, and all the others are blank! I can't seem to google for an action I can take to reset the 'file pointer' to the first character in the file. If I recall from years past, C++ has this capability.use Mail::Send; ...time passes, children are born... dbmopen(%CONTACT, "/httpd/userDBASE/contact", 0775) or die "Couldn't open DBASE: $!"; for $member (keys %CONTACT) { $CONTACT{$member} =~ /^\b(\S+)\b\s/; $msg = new Mail::Send( Subject => $subject, To => $1); open MSGBODY, "$file" or die "Couldn't open $file: $!"; $fh = $msg->open; while(<MSGBODY>) { print $fh "$_"; } $fh->close; close(MSGBODY); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Repeated File Opens Inefficient?
by robartes (Priest) on Mar 20, 2003 at 07:46 UTC | |
|
Re: Repeated File Opens Inefficient?
by PodMaster (Abbot) on Mar 20, 2003 at 07:45 UTC | |
|
Re: Repeated File Opens Inefficient?
by perlguy (Deacon) on Mar 20, 2003 at 07:51 UTC | |
|
Re: Repeated File Opens Inefficient?
by rjray (Chaplain) on Mar 20, 2003 at 07:48 UTC |