Hi,
Save the code as plain text file. And put it as a cron
job whenever you wish to run it. That will run it
uninteractively. 
However, if you like to run it manually. 
*Make the file executable
*Put it in the executable directory path. 
<Check out you path set by 'echo $PATH'>
<For testing put in your $HOME/bin directory and add
this line after the  PATH word in your home
.bash_profile file>
*Then check out the perl path by doing
<which perl>
*Depending on the result it returns change the header
of the script that is the line 
#!/usr/bin/perl -w 
*Then simply run the script by typing its name in the
shell prompt. 
*I really don't know if it works within kmail. But
give it a try and send the feedback. I hope it will
work that way also.

siddhartha



> > hmmm
> > just because i love perl
> > just because perl gives me time to waste :) We
> have ...
> > Cron her and let her go !
> >
> > Mail Blocker .01 beta
> >
> > #!/usr/bin/perl
> > use Net::POP3;
> > use strict;
> >
> > my $POP3server = 'vsnl.net'; # Guessing :)
> > my $username = '[EMAIL PROTECTED]'; # Your user name
> > my $password = 'k3W1p44S';  # Your password
> > my $hate_phrase = '[EMAIL PROTECTED]'; # You can play
> with this :)
> > ### Dont bother with the rest, well unless you
> want to :)
> >
> > my $pop3 = Net::POP3->new($POP3server);  #
> Constructor
> > my $no_of_mails = $pop3->login($username,
> $password); # Login to the server
> > exit if ($no_of_mails == 0); # Exit if there are
> no mails
> > for (1..$no_of_mails ) {
> > # Get to doing the job if there are mails
> > my $data = $pop3->get($_); # Get mail body
> > $pop3->delete($_) if ($data =~ /$hate_phrase/msi)
> # Delete mail if body
> > matches hate phrase
> > }
> >
> > $pop3->quit() # Dont forget to quit or POP3 will
> do nothing !!
> > # Should be in the class destructor instead of me
> having to call it... phew
> > the extra keystrokes !!
> 
> thanks 4 the codes. but how to use this?  should I
> make a shell script & 
> write down its name in the "run command " field of
> kmail ? pls. clarify. 
de.php?id=3

________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
       visit http://in.tv.yahoo.com

--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/node.php?id=3

Reply via email to