[31764] in Perl-Users-Digest
Perl-Users Digest, Issue: 3027 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 12 06:09:21 2010
Date: Mon, 12 Jul 2010 03:09:05 -0700 (PDT)
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, 12 Jul 2010 Volume: 11 Number: 3027
Today's topics:
Calling TCL libraries from Perl. <sood.amit@gmail.com>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <vilain@NOspamcop.net>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <vilain@NOspamcop.net>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <vilain@NOspamcop.net>
Re: How to convert link encoded by javascript command t sln@netherlands.com
Re: How to convert link encoded by javascript command t <pengyu.ut@gmail.com>
Re: regex Mcalpine to McAlpine <john1949@yahoo.com>
Re: regex Mcalpine to McAlpine <tadmc@seesig.invalid>
Re: regex Mcalpine to McAlpine <john1949@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 11 Jul 2010 22:29:01 -0700 (PDT)
From: Amit Sood <sood.amit@gmail.com>
Subject: Calling TCL libraries from Perl.
Message-Id: <b2d17d83-36a1-4ff0-8417-77c138807998@5g2000yqz.googlegroups.com>
Hi,
I have two different frameworks in TCL and Perl. To leverage the
libraries of both i am trying to interwork Perl and TCL.
I tried using TCL interpreter package in Perl. But the drawback with
that is, it only understand basic command and gives errors on add-on
commands (clock / parray). Also this is working only on windows and in
Linux it is giving some "Segmentation Fault".
Can somebody help me with ideas/suggestions to work on this
interoperability?
Thanks,
Amit
------------------------------
Date: Sun, 11 Jul 2010 14:14:04 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <upGdnYBDpv2jhafRnZ2dnUVZ_sWdnZ2d@earthlink.com>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:iq1k36l55den08rbpgdf2lgoba8ddfc6c0@4ax.com...
>>--- Accept an E-mail letter sent to some address at the Web site
>
> Extremely unlikely because email are not send to web site addresses.
> They are send to email addresses which have nothing whatsoever to do
> with WWW.
This looks like it is more complicated than originally thought. The
following is an outline of the situation.
Like most Internet users who have Web sites I am either renting Web
site space on some commercial firm's Web server or am using a free Web site.
Let's say I have site A on one Web server and site B on another. With each
I have registered with the site an E-mail address that server personnel can
use to contact me.
With site A I can send an E-mail to that server using my registered
E-mail address. And the server will automatically extract picture files
from my E-mail and store them in one of the directories at my Web site.
Unfortunately that service seems to run one day and not the next.
Sever B appears to me to be more reliable. And they have E-mail
handling programs available with my Web site package. But they do not have
programs in place that will extract files from E-mails sent to that Web
server. And it has been my assumption that some program at CPAN or at some
other location could be downloaded and stored at my Web site. And it would
do the same thing that is being done with the site on the A server.
From these discussions and my discussions with the people running
server B I am getting the impression that this E-mail file processing
feature might actually need to be built into the server itself. It could be
that it cannot be added by individual users.
With some further checking it should be possible to determine if that
is or is not the case. If not then I will simply have to run my Web site on
server B without that E-mail reading option.
------------------------------
Date: Sun, 11 Jul 2010 12:19:02 -0700
From: Michael Vilain <vilain@NOspamcop.net>
Subject: Re: CGI Program Questions
Message-Id: <vilain-8EAA67.12190211072010@news.individual.net>
In article <slrni3juf5.283.tadmc@tadbox.sbcglobal.net>,
Tad McClellan <tadmc@seesig.invalid> wrote:
> E.D.G. <edgrsprj@ix.netcom.com> wrote:
>
> > Subject: Re: CGI Program Questions
>
>
> You do not need a CGI program for this.
>
> CGI programs are for responding to HTTP requests.
>
> Nothing in your problem description leads me to believe
> that there is an HTTP request anywhere that needs to be
> responded to...
>
> Please re-read RedGrittyBrick's response again. It is chock full
> of good advice. If you don't understand what was said, ask a
> specific question about the part that you didn't understand.
>
>
> > After consulting with various parties including the ones who are running
> > the
> > Web server where I have a Web site it appears that not too many people know
> > how to answer these types of questions.
>
>
> Perhaps that is because what you request has nothing whatsoever
> to do with the World Wide Web.
>
>
> > Question: Can anyone recommend a specific Perl language program that can
> > be
> > stored on a Web site where it will do the following?
>
> > --- Accept an E-mail letter sent to some address at the Web site
>
>
> This has nothing to do with any Web site.
>
> This has something to do with email.
>
> email and the www are separate services, conflating them will make
> it harder for you to find a solution.
>
> I'm not too sure what "accept" means here. Do you have a working
> email system already? That is, can you send an email to the address
> that you want, and then read that email?
>
> Configuring email is not a Perl topic.
>
>
> > --- Extract attached files such as GIF picture files from the E-mail
> > letter
>
>
> That depends on how the files are attached.
>
> Seems likely that a module with "MIME" in its name would be
> helpful with that part.
>
>
> > --- Store those picture files in some directory at the Web site
>
> perldoc -f open
> perldoc -f binmode
> perldoc -f print
>
>
> > A Perl language program would be best.
>
> Writing a Perl language program would be best.
>
> Learn Perl or find someone who already knows Perl to do your job for you.
As has been pointed out at length here, the only part that's a
web-related is how the email is created. Once it's dispatched by the
code on the site, it becomes an email parsing problem. Setting up
something like an email filter for a specific email address depends on
how much management features your ISP gives you as part of their hosting
package. I've used ISPs that were pretty bare bones where you had to
ask for everything. Other ISPs had a web-based control panel to manage
a bunch of tasks, like installing perl modules, upgrading various
popular CMS packages, log analysis, etc.
I did something similar for my last contract. We had a backup system
that would spit out emails for "I'm done" and "I had a problem.". All
you could do is specify the email account to which it would send the
messages. We wanted the messages parsed for errors and flagged as a
problem so they could be seen to ASAP. I wrote a perl script that takes
an email message as input, breaks it apart using various CPAN modules
for manipulating email, parses for errors, then sends another email to
the sysadmin group saying "backup server PLUTO had a problem", with
extracts and the full message as an attachment. We modified the backup
server's email alias file to run the perl script for a specific email
address, much like you setup vacation. The backup system would show the
error of course, but now if it had been solved.
Try using this approach to your problem. If your ISP won't let you
manage email to allow for inserting scripts, then you'll either have to
find another ISP that will or run your own virtual server. Either way,
you'll be in over your head.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
------------------------------
Date: Sun, 11 Jul 2010 14:19:27 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <xICdnRFK5bbehKfRnZ2dnUVZ_uydnZ2d@earthlink.com>
"Tad McClellan" <tadmc@seesig.invalid> wrote in message
news:slrni3juf5.283.tadmc@tadbox.sbcglobal.net...
This looks it could be more complicated than I thought. It might even be
impossible with the Internet service I am using. Details can be found in my
response to Jürgen Exner's post.
------------------------------
Date: Sun, 11 Jul 2010 14:32:55 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <U8OdnTKvv9T0gafRnZ2dnUVZ_jydnZ2d@earthlink.com>
"Michael Vilain" <vilain@NOspamcop.net> wrote in message
news:vilain-8EAA67.12190211072010@news.individual.net...
Thanks for the comments. They appear to match the conclusions that I
myself have been reaching.
That E-mail processing feature is provided with the Web site package
I have on one server. And it is nice when it works. But it does not appear
to me to be very reliable from day to day.
My other server that looks more reliable does not automatically offer
that type of feature. And to my surprise it appears that there might not be
any downloadable programs on CPAN etc. that can do what I was hoping to
accomplish.
I am going to contact the people running that second server and
recommend that they develop and add that E-mail processing feature and offer
it to their customers. So far they seem to have never heard of anything
like that. Perhaps I can interest them in developing it though it is
probably unlikely that they will.
------------------------------
Date: Sun, 11 Jul 2010 13:46:09 -0700
From: Michael Vilain <vilain@NOspamcop.net>
Subject: Re: CGI Program Questions
Message-Id: <vilain-14882E.13460911072010@news.individual.net>
In article <U8OdnTKvv9T0gafRnZ2dnUVZ_jydnZ2d@earthlink.com>,
"E.D.G." <edgrsprj@ix.netcom.com> wrote:
> "Michael Vilain" <vilain@NOspamcop.net> wrote in message
> news:vilain-8EAA67.12190211072010@news.individual.net...
>
> Thanks for the comments. They appear to match the conclusions that I
> myself have been reaching.
>
> That E-mail processing feature is provided with the Web site package
> I have on one server. And it is nice when it works. But it does not appear
> to me to be very reliable from day to day.
>
> My other server that looks more reliable does not automatically offer
> that type of feature. And to my surprise it appears that there might not be
> any downloadable programs on CPAN etc. that can do what I was hoping to
> accomplish.
>
> I am going to contact the people running that second server and
> recommend that they develop and add that E-mail processing feature and offer
> it to their customers. So far they seem to have never heard of anything
> like that. Perhaps I can interest them in developing it though it is
> probably unlikely that they will.
Unless you have a very enlighted ISP or know the owner personally, I
have grave doubts you'll be able to influence a company to offering
something for which they see no "return on the investment". Being able
to set a "vacation" message is pretty standard and involved setting up
the email alias to filter through the vacation program. Setting the
message is just editing a file. If this company never heard of
vacation, they're probably Windows-based and you're well done with them.
Find a UNIX-based ISP that offers more services for less money. There
are lots out there.
I happily found A2hosting for my Drupal site. Bluehost was OK, but I
didn't want to give my money to a Mormon-based company since they tithe
earnings to their homophobic church. YMMV.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
------------------------------
Date: Sun, 11 Jul 2010 16:49:29 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <S-CdncW3z-T2oafRnZ2dnUVZ_tudnZ2d@earthlink.com>
"Michael Vilain" <vilain@NOspamcop.net> wrote in message
news:vilain-14882E.13460911072010@news.individual.net...
Thanks again for the comments. This is probably not the easiest way
to learn what CGI can and cannot do. But progress is being made with
reasonably good speed.
This particular project is part of an effort to develop resources
that will hopefully enable science researchers around the world to more
easily and effectively communicate with one another and share data etc.
Somewhat surprisingly, from what I can see, relatively few scientists
working in areas such as chemistry and physics appear to know too much about
Internet applications such as creating and running bulletin boards. And
that is probably slowing research efforts in a number of important areas. I
myself am not a professional programmer but with enough time can usually get
applications such as bulletin boards running. I personally like Perl though
I found it difficult to work with at first.
E.D.G.
------------------------------
Date: Mon, 12 Jul 2010 03:06:10 -0700
From: Michael Vilain <vilain@NOspamcop.net>
Subject: Re: CGI Program Questions
Message-Id: <vilain-9C7D77.03061012072010@news.individual.net>
In article <S-CdncW3z-T2oafRnZ2dnUVZ_tudnZ2d@earthlink.com>,
"E.D.G." <edgrsprj@ix.netcom.com> wrote:
> "Michael Vilain" <vilain@NOspamcop.net> wrote in message
> news:vilain-14882E.13460911072010@news.individual.net...
>
> Thanks again for the comments. This is probably not the easiest way
> to learn what CGI can and cannot do. But progress is being made with
> reasonably good speed.
>
> This particular project is part of an effort to develop resources
> that will hopefully enable science researchers around the world to more
> easily and effectively communicate with one another and share data etc.
> Somewhat surprisingly, from what I can see, relatively few scientists
> working in areas such as chemistry and physics appear to know too much about
> Internet applications such as creating and running bulletin boards. And
> that is probably slowing research efforts in a number of important areas. I
> myself am not a professional programmer but with enough time can usually get
> applications such as bulletin boards running. I personally like Perl though
> I found it difficult to work with at first.
>
> E.D.G.
I was trained as a chemist back in the 70's when computers where things
you fed punch cards or had in lab to drive instruments. After spending
20 years as a programmer and sysadmin, I left to study manual
therapy/bodywork (it has _nothing_ to do with cars). Most of my
colleagues are computer illiterate verging on computer phobic. We've
been using a Majordomo mailing list since 1997 to communicate amongst
ourselves. Every now and then, a new member joins the list, sees how
hard it is to filter through all the emails that come through, and
leaves. Plus there's no archive. Someone setup phpBB but the old folks
hate it. If we migrate to that, they'll leave.
Fast.
Cheap.
On Time.
Pick any 2.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
------------------------------
Date: Sun, 11 Jul 2010 20:17:49 -0700
From: sln@netherlands.com
Subject: Re: How to convert link encoded by javascript command to the actual url?
Message-Id: <3nvk369tjqe3pbu226c4qm3s2hqrg8lapk@4ax.com>
On Sun, 11 Jul 2010 14:22:13 -0700 (PDT), Peng Yu <pengyu.ut@gmail.com> wrote:
>On Jul 10, 1:15 pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
>> On 2010-07-10 17:29,PengYu<pengyu...@gmail.com> wrote:
>>
>> > Suppose I see a webpage on a website that has the following link
>> > encoded byjavascript, I want to user perl to parse such webpage and
>> > convert it to the actual url. Could you please let me know what
>> > package I should use? I thought that HTML package may not handle this.
>> > But please let me know if I'm wrong.
>>
>> ><a herf="javascript:some_command_return_a_url();">Link</a>
>>
>> I would start athttp://search.cpan.org/search?query=javascript&mode=all
>
>There are many results returned. Which one is the best one to help me
>solve my particular problem?
I'm a novice on the matter but it would seem to me that
javascript:some_command_return_a_url(); is embed and that when it
comes time to render the document, some_command_return_a_url() is
executed by a JS interp engine and assigned to that elements attribute
(href). But I'm not sure if thats the case and/or if "javascript:" is even
valid in this place (I'm too lazy to look it up at w3schools).
It would seem to me that such a package would have to be as powerfull as
a web browser with the ability to host a JS engine.
Because I don't know about these engines, I don't know if that engine
can actually call the underlying OS or that the host does, on its
behalf (sandbox and all that stuff).
It would be kind of cool to have your own back door browser that
rumages around web sites in real-time displaying a developer screen
that features a full featured debugger (like a m$ VS2008) for those
engines and html. Imagine, super automation, validation,
auto-created test cases, server hacking, scraping ..
The list is endless.
-sln
------------------------------
Date: Sun, 11 Jul 2010 14:22:13 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: How to convert link encoded by javascript command to the actual url?
Message-Id: <cb158163-e043-4bd4-b7dc-a7137af2927e@c10g2000yqi.googlegroups.com>
On Jul 10, 1:15=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2010-07-10 17:29,PengYu<pengyu...@gmail.com> wrote:
>
> > Suppose I see a webpage on a website that has the following link
> > encoded byjavascript, I want to user perl to parse such webpage and
> > convert it to the actual url. Could you please let me know what
> > package I should use? I thought that HTML package may not handle this.
> > But please let me know if I'm wrong.
>
> ><a herf=3D"javascript:some_command_return_a_url();">Link</a>
>
> I would start athttp://search.cpan.org/search?query=3Djavascript&mode=3Da=
ll
There are many results returned. Which one is the best one to help me
solve my particular problem?
------------------------------
Date: Sun, 11 Jul 2010 22:55:13 +0100
From: "John" <john1949@yahoo.com>
Subject: Re: regex Mcalpine to McAlpine
Message-Id: <i1dejv$pon$1@news.albasani.net>
<sln@netherlands.com> wrote in message
news:5guj36tasi2a2v7oi4djr6msoi6aa0j34t@4ax.com...
> On Sun, 11 Jul 2010 12:16:41 +0100, Ben Morrow <ben@morrow.me.uk> wrote:
>
>>
>>Quoth Tad McClellan <tadmc@seesig.invalid>:
>>>
>>> So then,
>>>
>>> s/\bMc([a-z])/Mc\U$1/;
>>> or
>>> s/(?<=\bMc)([a-z])/\U$1/;
>>>
>>>
>>> Good luck getting MacArthur from Macarthur without also getting
>>> MacHine from Machine...
>>
>> s/(?<=\bMac)(?!h)([a-z])/\U$1/;
>>
>>obviously...
>>
> ?? What about Machenderson ??
> I think Mc... is a little easier to "divine" than Mac...
> Either way, a list of valid names would have to be used.
> The point is moot.
>
> -sln
Hi
I just check for the following afterwards:
Mach Machete Machine Machinable Mackerel Macro Mace Macerate Macula
otherwise the replacement will be OK.
As you say, Mc, is easier.
Regards
John
------------------------------
Date: Sun, 11 Jul 2010 20:33:36 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: regex Mcalpine to McAlpine
Message-Id: <slrni3ks14.4h0.tadmc@tadbox.sbcglobal.net>
John <john1949@yahoo.com> wrote:
>
><sln@netherlands.com> wrote in message
> news:5guj36tasi2a2v7oi4djr6msoi6aa0j34t@4ax.com...
>> On Sun, 11 Jul 2010 12:16:41 +0100, Ben Morrow <ben@morrow.me.uk> wrote:
>>>Quoth Tad McClellan <tadmc@seesig.invalid>:
>>>>
>>>> So then,
>>>>
>>>> s/\bMc([a-z])/Mc\U$1/;
>>>> or
>>>> s/(?<=\bMc)([a-z])/\U$1/;
>>>>
>>>>
>>>> Good luck getting MacArthur from Macarthur without also getting
>>>> MacHine from Machine...
>>>
>>> s/(?<=\bMac)(?!h)([a-z])/\U$1/;
>>>
>>>obviously...
>>>
>> ?? What about Machenderson ??
>> I think Mc... is a little easier to "divine" than Mac...
>> Either way, a list of valid names would have to be used.
>> The point is moot.
>>
>> -sln
>
> Hi
>
> I just check for the following afterwards:
>
> Mach Machete Machine Machinable Mackerel Macro Mace Macerate Macula
There are 251 names that start with MAC at
http://names.mongabay.com/surnames_M.htm
A fair number of them should not be changed as you suggest..
MacHiavelli, MacIna, MacK, MacOmb etc...
> otherwise the replacement will be OK.
OK with you maybe, but almost for sure not OK with the person
whose name you mangle. [1]
[1] I often get snail mail addressed to Mr. Clellan, I assume
because there's only a few pixels difference between "c"
and "r" which confused an OCR program somewhere...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Mon, 12 Jul 2010 08:35:31 +0100
From: "John" <john1949@yahoo.com>
Subject: Re: regex Mcalpine to McAlpine
Message-Id: <i1egk0$894$1@news.albasani.net>
"Tad McClellan" <tadmc@seesig.invalid> wrote in message
news:slrni3ks14.4h0.tadmc@tadbox.sbcglobal.net...
> John <john1949@yahoo.com> wrote:
>>
>><sln@netherlands.com> wrote in message
>> news:5guj36tasi2a2v7oi4djr6msoi6aa0j34t@4ax.com...
>>> On Sun, 11 Jul 2010 12:16:41 +0100, Ben Morrow <ben@morrow.me.uk> wrote:
>>>>Quoth Tad McClellan <tadmc@seesig.invalid>:
>>>>>
>>>>> So then,
>>>>>
>>>>> s/\bMc([a-z])/Mc\U$1/;
>>>>> or
>>>>> s/(?<=\bMc)([a-z])/\U$1/;
>>>>>
>>>>>
>>>>> Good luck getting MacArthur from Macarthur without also getting
>>>>> MacHine from Machine...
>>>>
>>>> s/(?<=\bMac)(?!h)([a-z])/\U$1/;
>>>>
>>>>obviously...
>>>>
>>> ?? What about Machenderson ??
>>> I think Mc... is a little easier to "divine" than Mac...
>>> Either way, a list of valid names would have to be used.
>>> The point is moot.
>>>
>>> -sln
>>
>> Hi
>>
>> I just check for the following afterwards:
>>
>> Mach Machete Machine Machinable Mackerel Macro Mace Macerate Macula
>
>
> There are 251 names that start with MAC at
>
> http://names.mongabay.com/surnames_M.htm
>
> A fair number of them should not be changed as you suggest..
>
> MacHiavelli, MacIna, MacK, MacOmb etc...
>
>
>> otherwise the replacement will be OK.
>
>
> OK with you maybe, but almost for sure not OK with the person
> whose name you mangle. [1]
>
>
>
>
>
> [1] I often get snail mail addressed to Mr. Clellan, I assume
> because there's only a few pixels difference between "c"
> and "r" which confused an OCR program somewhere...
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
> The above message is a Usenet post.
> I don't recall having given anyone permission to use it on a Web site.
There is a nice routine on Andy Kramek's blog. Google "Andy Kramek
checkscots".
I dare say some names will be mangled. Macey is the obvious one.
Give it to a first year student as an exercise is probably the best
approach.
Regards
John
------------------------------
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 3027
***************************************