[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Mac::Glue?



>Since I don't have Claris Emailer, I cannot test.  Did you check for an
>error with $^E?
>
>  $foo->connect_to($_);
>  die $^E if $^E;
>
>How about adding a 'print $_, "\n"' to the loop and sending the results to
>the list so we can see exactly what is in $_?
>
>  print $_, "\n";
>  $foo->connect_to($_);

This morning I find that I can't duplicate the error!

I added both your bits of code, and at no point does the script die, so 
$^E isn't happening.

the print statment produces:

Linknet
Telebyte

with a longish pause in between while Emailer makes it's connection to 
the server and checks for mail on Linknet --  pretty much what I 
excpeted, the contents are just strings.

at any rate, I'm not using this method in the *real* script:

#!perl -w
use strict;
use Mac::Glue;

my $obj = new Mac::Glue 'Claris_Emailer_1_1v3';
$obj->connect_to("Internet", checking => 1, sending => 1) or die $^E;

handles the whole thing.  Brief and to the point.

Okay, but this:

#!perl -w
use strict;
use Mac::Glue;
use vars qw($obj @raw_accounts);

$obj = new Mac::Glue 'Claris_Emailer_1_1v3';
@raw_accounts = $obj->get_accounts();

foreach (@raw_accounts) {
	print $_, "\n";
    $obj->connect_to($_);
	die $^E if $^E;
}

fails with no error.  This:

#!perl -w
use strict;
use Mac::Glue;
use vars qw($obj @raw_accounts);

$obj = new Mac::Glue 'Claris_Emailer_1_1v3';
@raw_accounts = $obj->get_accounts();

foreach (@raw_accounts) {
	print $_, "\n";
    $obj->connect_to($_, checking => 1, sending => 1);
	die $^E if $^E;
}

works.  So much for "checking" and "sending" being optional.

--B


# Brian McNett                                      Fungal Parataxonomy
# Webmaster, Staff Writer               Mycology Information (Mycoinfo)
#                              **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/>
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org