[31416] in Perl-Users-Digest
Perl-Users Digest, Issue: 2668 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 09:09:43 2009
Date: Mon, 9 Nov 2009 06:09:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 9 Nov 2009 Volume: 11 Number: 2668
Today's topics:
connect to localhost failed error with Mail::Sendmail o <himanshu.garg@gmail.com>
Re: connect to localhost failed error with Mail::Sendma <smallpond@juno.com>
Re: connect to localhost failed error with Mail::Sendma <bart.lateur@pandora.be>
Re: connect to localhost failed error with Mail::Sendma <himanshu.garg@gmail.com>
good perl hosts <robin1@cnsp.com>
Re: good perl hosts <spamtrap@shermpendley.com>
Re: good perl hosts <himanshu.garg@gmail.com>
OT: regular expression matching multiple occurrences of <pinkisntwell@gmail.com>
Re: Problem on subversion using propset with perl on a <hartigan@sincity.real.life>
Re: remove elements from array ref <jurgenex@hotmail.com>
Re: remove elements from array ref (Seymour J.)
Searching regular expr: How to match the following patt (Peter Stacy)
Re: Searching regular expr: How to match the following <someone@example.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 8 Nov 2009 03:39:59 -0800 (PST)
From: "++imanshu" <himanshu.garg@gmail.com>
Subject: connect to localhost failed error with Mail::Sendmail on Windows
Message-Id: <f6840c7e-16a4-40a4-b17a-3f80b03856fd@m33g2000pri.googlegroups.com>
Hi,
I am trying the example script of Mail::Sendmail with ActivePerl
on windows pc connected to the internet:-
---
- trying localhost
- connect to localhost failed (Unknown error)
retrying in 1 seconds...
- connect to localhost failed, next server...
connect to localhost failed (Unknown error)
connect to localhost failed
connect to localhost failed (Unknown error) no (more) retries!
---
This is the script :-
use Mail::Sendmail;
%mail = ( To => 'random.random@gmail.com',
From => 'random@yahoo.com',
Message => "This is a very short message",
);
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
---
What can I set $mail{smtp} so that it works?
Thank You,
++imanshu
------------------------------
Date: Sun, 8 Nov 2009 09:03:02 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: connect to localhost failed error with Mail::Sendmail on Windows
Message-Id: <a5caa707-1ef5-4063-8e29-45497c5fb80b@d21g2000yqn.googlegroups.com>
On Nov 8, 6:39=A0am, "++imanshu" <himanshu.g...@gmail.com> wrote:
> Hi,
>
> =A0 =A0 =A0I am trying the example script of Mail::Sendmail with ActivePe=
rl
> on windows pc connected to the internet:-
>
> ---
> - trying localhost
> - connect to localhost failed (Unknown error)
> retrying in 1 seconds...
> - connect to localhost failed, next server...
> connect to localhost failed (Unknown error)
> connect to localhost failed
> connect to localhost failed (Unknown error) no (more) retries!
> ---
>
> =A0 =A0 =A0This is the script :-
>
> =A0 use Mail::Sendmail;
>
> =A0 %mail =3D ( To =A0 =A0 =A0=3D> 'random.ran...@gmail.com',
> =A0 =A0 =A0 =A0 =A0 =A0 From =A0 =A0=3D> 'ran...@yahoo.com',
> =A0 =A0 =A0 =A0 =A0 =A0 Message =3D> "This is a very short message",
> =A0 =A0 =A0 =A0 =A0 );
>
> =A0 sendmail(%mail) or die $Mail::Sendmail::error;
>
> =A0 print "OK. Log says:\n", $Mail::Sendmail::log;
>
> ---
>
> =A0 =A0 =A0What can I set $mail{smtp} so that it works?
>
> Thank You,
> ++imanshu
Installation instructions for Mail::Sendmail:
"At the top of Sendmail.pm, set your default SMTP server(s),
unless you specify it with each message, or want to use the
default (localhost)."
Default is that you are running an smtp mail program listening
on your machine's smtp port. If you don't know what that is
then you don't have one.
Otherwise you need to have a server somewhere else that
supports smtp. Usually, your isp will provide an smtp
server like mail.myisp.net; see their support website.
Some cheap isps now only provide web-based email, in which
case you tell them to go get a new customer.
------------------------------
Date: Sun, 08 Nov 2009 21:18:16 +0100
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: connect to localhost failed error with Mail::Sendmail on Windows
Message-Id: <5p9ef55ubha6jbfehi1jv48nt36p1qr722@4ax.com>
++imanshu wrote:
>Hi,
>
> I am trying the example script of Mail::Sendmail with ActivePerl
>on windows pc connected to the internet:-
I think this module expects sendmail to be running on your computer, or
on a computer in your local network, and with Windows, that's not very
likely.
Why aren't you using SMTP?
If you use MIME::Lite, you can easily switch between the two, which is
handy even if your mails aren't MIME mails.
--
Bart.
------------------------------
Date: Mon, 9 Nov 2009 01:45:05 -0800 (PST)
From: "++imanshu" <himanshu.garg@gmail.com>
Subject: Re: connect to localhost failed error with Mail::Sendmail on Windows
Message-Id: <da4640aa-c4ef-4c34-a9e3-64446a752ec5@s21g2000prm.googlegroups.com>
On Nov 8, 11:03=A0pm, smallpond <smallp...@juno.com> wrote:
> On Nov 8, 6:39=A0am, "++imanshu" <himanshu.g...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > =A0 =A0 =A0I am trying the example script of Mail::Sendmail with Active=
Perl
> > on windows pc connected to the internet:-
>
> > ---
> > - trying localhost
> > - connect to localhost failed (Unknown error)
> > retrying in 1 seconds...
> > - connect to localhost failed, next server...
> > connect to localhost failed (Unknown error)
> > connect to localhost failed
> > connect to localhost failed (Unknown error) no (more) retries!
> > ---
>
> > =A0 =A0 =A0This is the script :-
>
> > =A0 use Mail::Sendmail;
>
> > =A0 %mail =3D ( To =A0 =A0 =A0=3D> 'random.ran...@gmail.com',
> > =A0 =A0 =A0 =A0 =A0 =A0 From =A0 =A0=3D> 'ran...@yahoo.com',
> > =A0 =A0 =A0 =A0 =A0 =A0 Message =3D> "This is a very short message",
> > =A0 =A0 =A0 =A0 =A0 );
>
> > =A0 sendmail(%mail) or die $Mail::Sendmail::error;
>
> > =A0 print "OK. Log says:\n", $Mail::Sendmail::log;
>
> > ---
>
> > =A0 =A0 =A0What can I set $mail{smtp} so that it works?
>
> > Thank You,
> > ++imanshu
>
> Installation instructions for Mail::Sendmail:
>
> "At the top of Sendmail.pm, set your default SMTP server(s),
> unless you specify it with each message, or want to use the
> default (localhost)."
yes I wrongly assumed smtp to be so simple that the module alone could
handle it without another server. There were some EHLO, HELO strings
in the pm file which reinforced my wrong assumption.
>
> Default is that you are running an smtp mail program listening
> on your machine's smtp port. =A0If you don't know what that is
> then you don't have one.
now i understand that i do need one.
>
> Otherwise you need to have a server somewhere else that
> supports smtp. =A0Usually, your isp will provide an smtp
> server like mail.myisp.net; see their support website.
> Some cheap isps now only provide web-based email, in which
> case you tell them to go get a new customer.
My ISP apparently provides relay but under another costlier plan!!
Thank You,
++imanshu
------------------------------
Date: Sun, 08 Nov 2009 19:31:35 -0700
From: Robin <robin1@cnsp.com>
Subject: good perl hosts
Message-Id: <hd7us4$1ju2$1@adenine.netfront.net>
Does anybody know of any free web hosts that host perl cgi? I am sorry
to bring this up here, but I am going absolutely nuts trying to find
one. None of them work and it is very frustrating, the search...
Thanks in advance,
-Robin
------------------------------
Date: Sun, 08 Nov 2009 22:00:41 -0500
From: Sherm Pendley <spamtrap@shermpendley.com>
Subject: Re: good perl hosts
Message-Id: <m2iqdkbdwm.fsf@shermpendley.com>
Robin <robin1@cnsp.com> writes:
> Does anybody know of any free web hosts that host perl cgi?
Dreamhost supports CGI and FastCGI for a reasonable price, and includes
shell access so you can install your own modules.
And best of all, you can support the CamelBones Cocoa/Perl bridge by
telling them I (sherm.pendley@gmail.com) sent you! :-)
<http://www.dreamhost.com>
sherm--
------------------------------
Date: Sun, 8 Nov 2009 23:41:36 -0800 (PST)
From: "++imanshu" <himanshu.garg@gmail.com>
Subject: Re: good perl hosts
Message-Id: <1d169d7b-b685-49a9-9a67-7e89994973e1@v15g2000prn.googlegroups.com>
On Nov 9, 8:31=A0am, Robin <rob...@cnsp.com> wrote:
> Does anybody know of any free web hosts that host perl cgi? I am sorry
> to bring this up here, but I am going absolutely nuts trying to find
> one. None of them work and it is very frustrating, the search...
>
> Thanks in advance,
> -Robin
While most would support perl/cgi, check modperl support if you plan
to upgrade later from cgi to modperl.
Thank You,
++imanshu
------------------------------
Date: Mon, 9 Nov 2009 05:53:00 -0800 (PST)
From: pinkisntwell <pinkisntwell@gmail.com>
Subject: OT: regular expression matching multiple occurrences of one group
Message-Id: <8fcc863d-dd85-43ba-bdc7-7c3575431fb6@j19g2000yqk.googlegroups.com>
How can I make a regular expression that will match every occurrence
of a group and return each occurrence as a group match? For example,
for a string "-c-c-c-c-c", how can I make a regex which will return a
group match for each occurrence of "-c"?
------------------------------
Date: Mon, 09 Nov 2009 15:09:03 +0100
From: Hartigan <hartigan@sincity.real.life>
Subject: Re: Problem on subversion using propset with perl on a svn:external
Message-Id: <jlVJm.30180$813.12507@tornado.fastwebnet.it>
If someone need something that change a svn:external on a remote svn repository can try to start with lines of code.
The problem is that the SVN::Client not support the change of the prop in a remote repository (the command line yes with
propedit...). So the idea is to get the url, checkout it, change on the working copy, commit, and remove the temporary
working copy...
If someone need to do something like this, this is a base, so you don't loose time like me to understand why not work...
use SVN::Client;
use File::Remove 'remove';
sub svnupdateexternals {
my ($svn_ext_ctx,$svn_ext_url,$svn_ext_link,$svn_ext_target) = @_;
my $recursive = "0";
my $svn_ext_path = "/tmp/external-update-".$$;
my $svn_ext_name="svn:externals";
my $svn_ext_rev="HEAD";
my $svn_ext_force="0";
my $svn_ext_hash = $svn_ext_ctx->propget($svn_ext_name,$svn_ext_url,$svn_ext_rev,$svn_ext_force);
my $svn_ext_newexternal="";
my $svn_ext_setprop="";
my $svn_ext_count="1";
my ($svn_ext_key, $svn_ext_value) = each(%$svn_ext_hash);
print "Key:$svn_ext_key\n\nValue:\n$svn_ext_value\n";
foreach (split(/\n/,$svn_ext_value)) {
my $svn_ext_external=$_;
#if you want some useful message uncoment print lines
#print "-----------------\n";
#print "External$svn_ext_count: $svn_ext_external\n";
$svn_ext_count++;
my @svn_ext_exter=split(/\s+/,$svn_ext_external);
#if you want some useful message uncoment print lines
#print "+++++++++++++++++++++\n";
#print "\tName: $svn_ext_exter[0]\n";
#print "\tUrl: $svn_ext_exter[1]\n";
if ( $svn_ext_exter[0] eq $svn_ext_link ) {
$svn_ext_exter[1]=$svn_ext_target;
$svn_ext_setprop="1";
}
$svn_ext_newexternal=$svn_ext_newexternal."$svn_ext_exter[0] $svn_ext_exter[1]\n";
}
print "\n\n\n";
if ( $svn_ext_setprop eq "1" ) {
#if you want some useful message uncoment print lines
#print "Set svn:external\n";
#print "================\n";
#print "Key:$svn_ext_key\n\n";
#print "Value:\n";
#print "Tmpdir: $svn_ext_path\n";
#print $svn_ext_newexternal;
my $svn_ext_logmsg="Operation: Change svn:externals\nRepo path:
$svn_ext_url\n\nFrom:\n$svn_ext_value\nTo:\n$svn_ext_newexternal\n";
#print "Log message: $svn_ext_logmsg";
$svn_ext_ctx->checkout($svn_ext_url, $svn_ext_path, "HEAD", $recursive);
$svn_ext_ctx->propset($svn_ext_name,$svn_ext_newexternal,$svn_ext_path,$svn_ext_force);
svnsetlogmsg($svn_ext_ctx,$svn_ext_logmsg);
$svn_ext_ctx->commit($svn_ext_path, $recursive);
remove( \1, $svn_ext_path );
} else {
#if you want some useful message uncoment print lines
#print "Value:\n";
#print $svn_ext_value;
}
}
#This is equivalent of the example in the doc to set the message in a svn operation...
sub svnsetlogmsg {
my ($svn_log_ctx, $svn_set_log_mesg) = @_;
my $svn_set_log_msg_handler = sub {
my $stringptr = shift;
$$stringptr = $svn_set_log_mesg;
return 1;
};
$svn_log_ctx->log_msg($svn_set_log_msg_handler);
};
Hartigan wrote:
> Hi all,
> i'm working to create some perl scripts to make changes on a svn(subversion)
> respository. One of this script try to change a svn:external but i have
> a problem to do this with the propset().
>
> I have a testing repository with this path
>
> http://localhost/svn/testing/develop_area/mail
>
> under this directory there are two svn:externals:
>
[Big cut!!!]
>
> Anyone have an idea about this problem ?
> Any idea on how change a svn:externals via perl on a remote repository?
>
> Thank you
------------------------------
Date: Sat, 07 Nov 2009 18:18:22 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: remove elements from array ref
Message-Id: <hhacf55s5mjs0p6f0sptui8f6b2t3164iu@4ax.com>
monkeys paw <user@example.net> wrote:
>The folllowing code is supposed to remove entries from
>@return_set that end in '000'. It leaves an undef in
>the array instead of removing the whole element. What
>fix would be best to achieve an array without 'undef'
>elements?
I would simply use a grep() instead of rolling my own code. This is
exactly the scenario it was made for.
jue
------------------------------
Date: Sun, 08 Nov 2009 10:12:24 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: remove elements from array ref
Message-Id: <4af6dfd8$7$fuzhry+tra$mr2ice@news.patriot.net>
In <_8GdnRRI7Y5YU2jXnZ2dnUVZ_tmdnZ2d@insightbb.com>, on 11/07/2009
at 02:47 PM, monkeys paw <user@example.net> said:
>The folllowing code is supposed to remove entries from
>@return_set that end in '000'. It leaves an undef in
>the array instead of removing the whole element.
" Note that deleting array elements in the middle of an array will not
shift the index of the ones after them down--use splice() for that."
BTW, if delete $array[$index] worked the same as splice @array,$index,1
you'd have another problem, because your $i would be wrong after the first
delete.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: 08 Nov 2009 08:16:26 GMT
From: pete45@yahoo.net (Peter Stacy)
Subject: Searching regular expr: How to match the following pattern with quotes, brackets and semicolons?
Message-Id: <4af67e5a$0$6564$9b4e6d93@newsspool4.arcor-online.net>
In a file I am searching for (the first) expression which matches the following pattern:
aabbcc('<some chars or digits but no special chars nor CRs>',<zero or one blank>'<one or more digits>');
Mind the quotes ' ! Do I have to escape/mask them ?
How can I setup an according regular expression?
Peter
------------------------------
Date: Sun, 08 Nov 2009 01:27:54 -0800
From: "John W. Krahn" <someone@example.com>
Subject: Re: Searching regular expr: How to match the following pattern with quotes, brackets and semicolons?
Message-Id: <vawJm.2836$dc2.2698@newsfe20.iad>
Peter Stacy wrote:
> In a file I am searching for (the first) expression which matches the following pattern:
>
> aabbcc('<some chars or digits but no special chars nor CRs>',<zero or one blank>'<one or more digits>');
First define how many "some" is and what are "some chars" and what are
"special chars".
> Mind the quotes ' ! Do I have to escape/mask them ?
No.
> How can I setup an according regular expression?
/aabbcc\('[<chars>0-9]{<some>}', ?'[0-9]+'\);/
Where <chars> and <some> should be replaced with valid values.
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2668
***************************************