
-----------------------------------
Insectoid
Sun Dec 07, 2008 7:09 pm

All my Perl questions!
-----------------------------------
So, I figured I'm the only one asking about Perl on this site, may as well put everything in one thread. 

My current question is, how can I connect to my Hotmail address to send E-mails or delete spam automatically? Currently, I have,


#!/usr/bin/perl

$title = 'Test';
$to = "my_email@hotmail.com";
$from = "my_email@hotmail.com";
$subject = "Test";

open (MAIL, "|/usr/sbin/sendmail -t");

	print MAIL "To: $to\n";
	print MAIL "From: $from\n";
	print MAIL "Subject: $subject\n\n";
	print MAIL "TEST\n";
close (MAIL);


This doesn't return any errors, but won't send the mail (likely due to the absence of a password). Do I need to set up an e-mail server? How hard would that be?

-----------------------------------
apomb
Sun Dec 07, 2008 7:13 pm

Re: All my Perl questions!
-----------------------------------
you will need to install sendmail. are you running these programs from a linux command line?

-----------------------------------
Insectoid
Sun Dec 07, 2008 7:17 pm

RE:All my Perl questions!
-----------------------------------
I'm on mac (which is based on unix). I'm running these from the terminal (perl emailtest.pl). Is there a way to do this without sendmail?

-----------------------------------
Tony
Sun Dec 07, 2008 7:27 pm

RE:All my Perl questions!
-----------------------------------
You need a mailserver to send the actual email. If you don't want to run one locally, then you would need to connect to a remote one.

-----------------------------------
Unforgiven
Sun Dec 07, 2008 7:32 pm

Re: All my Perl questions!
-----------------------------------
There are many options on CPAN, but [url=http://search.cpan.org/~rjbs/MIME-Lite-3.023/lib/MIME/Lite.pm]this may be of use to you.

-----------------------------------
Insectoid
Wed Dec 10, 2008 4:10 pm

RE:All my Perl questions!
-----------------------------------
Okay, new question. Does Perl support sending data to specific hardware IDs/addresses/pots/whatever those are called? I know the USB port has 3 4-digit IDs, one for inputting to the computer, one for outputting to the USB port, and one to interrupt the device. Can I send data directly to those locations, without using additional modules? Do 'nix OSes use the same hardware ID systems as Windows?

-----------------------------------
wtd
Wed Dec 10, 2008 6:01 pm

RE:All my Perl questions!
-----------------------------------
Perl has no specific syntactic support for those things, but the underlying implementation for Perl is C, and C can do those things, so you will find the ability to do them in Perl in a module.

-----------------------------------
btiffin
Wed Dec 10, 2008 6:06 pm

RE:All my Perl questions!
-----------------------------------
insectoid;  Google  Sys::PortIO  see if that can float your boat.  I can't speak as to have ever used it.  Me and Perl have a history of not getting along.  But I still try and be its friend from time to time.

On the OpenCOBOL project, a gentleman from Japan has coded up a cob_perl module and his sample is for accessing barcode readers.  That will form a small, but critical part of the Open Source Point Of Sale system that we have dancing around our backburners.

Cheers

-----------------------------------
Insectoid
Wed Dec 10, 2008 7:06 pm

RE:All my Perl questions!
-----------------------------------
Great. More modules. Can somebody walk me through configuring the CPAN command line downloader on my mac? I tried, but it fails to connect to any of the mirrors.

EDIT: Btiffin, your module appears to be designed for Linux, FreeBSD and OpenBSD. Is it still compatible with mac?

EDIT 2: It only works with parallel, serial, and joystick ports. I would rather communicate with DVI, USB, and firewire.

-----------------------------------
btiffin
Wed Dec 10, 2008 7:12 pm

RE:All my Perl questions!
-----------------------------------
Sorry insectoid, no idea.  I haven't had a Mac since my LC630 borked some 10 years ago.

Best of skill though.  From what I've seen of your intelligent posts and good works, I have faith you'll get it figured and dancing before you know it.

Cheers

-----------------------------------
gianni
Thu Dec 11, 2008 4:18 pm

Re: RE:All my Perl questions!
-----------------------------------
Great. More modules. Can somebody walk me through configuring the CPAN command line downloader on my mac? I tried, but it fails to connect to any of the mirrors.

EDIT: Btiffin, your module appears to be designed for Linux, FreeBSD and OpenBSD. Is it still compatible with mac?

EDIT 2: It only works with parallel, serial, and joystick ports. I would rather communicate with DVI, USB, and firewire.
DVI is a video port.

From what I understand, accessing USB/FW is much different than your standard COM ports. Dealing with USB actually requires dealing with whatever peripheral is connected/associated driver. As opposed to just sending raw data somewhere.

Also, if the module is BSD compatible it is more than likely OS X compatible, as OS X is mainly [url=http://developer.apple.com/Darwin/]BSD-based.
