<html>
<font face="Arial, Helvetica">Ok, some time back I asked for help getting
an email to replace a file in my public-html folder. The solution
is below.<br>
</font><font size=2>-------------------------------------<br>
#!/usr/bin/perl<br><br>
#read the _whole_ file from stdin into $_;<br>
undef $/;<br>
$_=<STDIN>;<br><br>
#get rid of the email headers<br>
# headers are seperated from the body of the message by a blank
line.<br>
s/^.*?\n\n//gs;<br><br>
open(DATA, ">public_html/registered_names.txt") or <br>
<x-tab> </x-tab>die
"failed to open public_html/registered_names.txt: $!\n";<br>
print DATA $_;<br>
close(DATA);<br>
--------<br><br>
Then in ~/.procmailrc do something like:<br>
---<br>
:0<br>
* ^From:.*callen@corpus.wa.edu.au<br>
| /path/to/script<br>
---<br>
</font>-------------------------------------------------------<br>
<font face="Arial, Helvetica">What i now need is for it to work
differently, i need it to split into 2 different files.<br>
The email will look something like this<br>
</font>---------------------<br>
Matthew Whocare<br>
Sarah Wile<br>
Katlen Minkle<br>
Mill Nasf<br>
---------------------<br>
The that i need are below<br>
---------------------<br>
registered.txt<br>
----<br>
Matthew Whocare<br>
Sarah Wile<br>
Katlen Minkle<br>
Mill Nasf<br>
---------------------<br>
registered_flash.txt<br>
----<br>
names=Matthew Whocare<br>Sarah Wile<br>Katlen
Minkle<br>Mill Nasf<br>
----<br>
<font face="Arial, Helvetica">I don't no how to script other than simple
stuff.<br>
Thanks,<br>
Tim<br><br>
</font><x-sigsep><p></x-sigsep>
LinuxAlien<br>
Riverton, Perth, WA<br><br>
Australian Linux Technical Conference, Perth 2003
<a href="http://linux.conf.au/" eudora="autourl">http://</a>linux.conf<a href="http://linux.conf.au/" eudora="autourl">.au</a></html>