The Monday 2004-11-01 at 15:18 -0600, Danny Sauer wrote:
Ok, this is *way* easier if you use the CPAN shell. Get yourself set up as a user who can install perl modules (typically this means root), and type perl -MCPAN -e'shell' Answer the questions, and type install Email::MIME::Attachment::Stripper (for example). The cpan module will take care of installing the module and whatever modules are required. If you say "follow" rather than the default of "ask" when the CPAN setup prompts you about how to handle dependencies, you won't even have to say "yes" when it asks to download the deps. Overall the CPAN shell is super nice.
I had heard of that method. However... I suppose in this case it would have tried to update most of everything to the newest - because Email-MIME-Encodings-1.3 wanted to update, MIME::Base64 3.05 and MIME::QuotedPrint 3.03, and those would surely want to update something else... an endless chain. I decided to install instead the older Email-MIME-Encodings-1.1, which was happy with what was on the system. As I'm not an expert, but at the start of principiant, I don't want to change any thing but the strictest necessities - perhaps i could break something, like amavis. Thus I prefer the slow, manual method. I control it. Some other time :-)
Now, test your code [...] ¡It works! :-)
Well, that much is good. :)
Well, it doesn't put a text saying that the file was removed. Probably I can live with that, at least for the set of mails I want to handle.
Pull the body off, stick a line at the end, reattach the body. Or, add a new text attachment whose contents are "file $filename removed", etc. :) Hooray for having the source code, eh?
Yes, the second method is preferable, no modifying of the email text. I would have to learn how to do it, yet :-)
[...]
You probably want to look at Date::Parse for that. It works quite well. For finding modules, I usually use http://search.cpan.org/ (though that particular module is one that I use often for log parsing, etc).
I'll have a look. That module is included by SuSE, it is installed.
Yes, "info perl" says to look at "perlintro", but I get "not found". There is only "perldoc", which assumes I already know what module I want to look at. [...] Mmmm.... there is a "man perlintro". Is that it? Not a browsable help? Pfff. :-(
The perl documentation is viewable using the perldoc program, which functions similarly to man or info.
But 'pinfo' style would be preferable; perldoc does not navigate documents.
So, "perldoc perlinfo" is what you're looking for as a start.
cer@nimrodel:~> perldoc perlinfo No documentation found for "perlinfo". It doesn't work. And 'pin' doesn't find it.
If you do a "man perl", you'll get a list of lots of other docs that are also included, those sections are further described under "perldoc perltoc".
Ok - this document is 12858 lines long, a long, long plain file. It can not be searched easily, no _links_. Try, for example "pinfo fetchmail" (not info fetchmail). There is a line like this: |> You can then handle the retrieved mail using normal mail |> user agents such as mutt(1), elm(1) or Mail(1). The words mutt(1), elm(1) or Mail(1) are printed in green in the xterm text. I can click with the mouse, or cursor to elm(1) till it is red, hit enter, and open that man page. Left cursor will put me back on the previous documents. Ie, I can navigate plain man pages. But perldoc doesn't do that. It is a "TOC" whose entries do not automatically take me to the referred documentation. Maybe there is a web page somewhere, but as I don't have a permanent network connection, I would have to mirror it locally, if possible. Another thing: pinfo adapts to xterm size, and reflows the text; perldoc doesn't. Or, what would be most useful to me, a hierarchical index of modules and functions available, so that having an idea of what I want to accomplish, I can find what module does what I want to do. To use a man page I already have to know its name. You know, I'm spoilt. During the time I programmed for a living, I used mostly Borland C and Borland Pascal - not only the IDE is magnific, but the online help was so good that I learned to program TP without a manual (of course, I had had classes, formal training). When I did get the TP manual (which were also splendid) I became a guru. Easy! I'm spoilt: anything sort of that kind of environment and I start fidgeting O:-)
Most of the time, the main perl docs are also installed as man pages, so you can do things like "man perlintro", or, for a nice read, "man -t perlintro | lpr". The perldsc page and the perlfaq pages should be mandtory reading, and the prelretut page will do wonders for the regexp uninitiated.
Finally, read perlstyle, and start most any program out with #!/usr/bin/perl -w use strict; That'll really encourage clean, reliable code. Oh, and you'll likely want perlcheat located nearby for a while. :)
I will read some of them, of course. :-)
--Danny, willing to take this off-list if no one else cares ;)
Who knows? There are always people reading even if they don't contribute. -- Cheers, Carlos Robinson