[26690] in Perl-Users-Digest
Perl-Users Digest, Issue: 8796 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 25 14:05:19 2005
Date: Sun, 25 Dec 2005 11:05:04 -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 Sun, 25 Dec 2005 Volume: 10 Number: 8796
Today's topics:
Re: BEGIN { package Foo; use Foo } <sdn.girths00869@zoemail.net>
Re: Convert utf-8 to latin1 <Philip.Baker@thalasson.com>
Re: Convert utf-8 to latin1 <jurgenex@hotmail.com>
Re: Convert utf-8 to latin1 <dreamer@cox.net>
Re: Exiting without printing <NoSPam@NoSpam.com>
Re: How to automatically submit html for data? <mark.clementsREMOVETHIS@wanadoo.fr>
Re: How to automatically submit html for data? <itfred@cdw.com>
Re: How to automatically submit html for data? <tadmc@augustmail.com>
Re: How to automatically submit html for data? <itfred@cdw.com>
Re: How to automatically submit html for data? <itfred@cdw.com>
Re: How to automatically submit html for data? <no@email.com>
not a valid win32 application <vzeo882n@verizon.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 25 Dec 2005 03:19:22 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: BEGIN { package Foo; use Foo }
Message-Id: <Xns97372C5EBB1Dsdn.comcast@216.196.97.136>
kj <socyl@987jk.com.invalid> wrote in
news:dol77h$9kl$1@reader1.panix.com:
> The workaround I cited is
>
> BEGIN { package Config::Std; use Config::Std }
>
> but I think it has a lot of problems.
I agree; I'm not sure I'd trust this not to break something.
> My original question then
> remains: what's the best way to avoid having read_config imported
> and still know how to refer to it?
Why is importing such an issue?
>
> Another possibility is
>
> BEGIN { package Config::Std::Some::Crazy::Name; use Config::Std }
>
> Then the desired function is reliably
> Config::Std::Some::Crazy::Name::read_config, though I have to hope
> that I have not inadvertently introduced a collision.
That's about the only thing I can think of....
--
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`
------------------------------
Date: Sun, 25 Dec 2005 05:44:09 +0000
From: Philip Baker <Philip.Baker@thalasson.com>
Subject: Re: Convert utf-8 to latin1
Message-Id: <KGxKjDAoGjrDFwey@thalasson.com>
In article <C5udnSF73v6XSjDeRVnyiA@giganews.com>, Fred Hare
<dreamer@cox.net> writes
>I am working on a script to convert utf-8 to latin1.
I use this regex:
s/([\xc2-\xc3])([\x80-\xbf])/chr(64*ord($1&"\x03")+ord($2&"\x3f"))/eg
--
Philip Baker
------------------------------
Date: Sun, 25 Dec 2005 06:23:55 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Convert utf-8 to latin1
Message-Id: <%Vqrf.661$X86.40@trnddc04>
Fred Hare wrote:
> Hello there,
> I am working on a script to convert utf-8 to latin1. What I have so
> far [...]
I assume you do do realize that latin1 is only a very small subset of
Unicode?
> Or is there a better way?
Why not just use Text::Iconv?
That worked very well for me.
jue
------------------------------
Date: Sun, 25 Dec 2005 06:40:20 -0800
From: Fred Hare <dreamer@cox.net>
Subject: Re: Convert utf-8 to latin1
Message-Id: <Zv2dnTcKDs_BMjPeRVnyrA@giganews.com>
Jürgen Exner wrote:
> Fred Hare wrote:
>
>>Hello there,
>>I am working on a script to convert utf-8 to latin1. What I have so
>>far [...]
>
>
> I assume you do do realize that latin1 is only a very small subset of
> Unicode?
>
>
>> Or is there a better way?
>
>
> Why not just use Text::Iconv?
> That worked very well for me.
>
> jue
>
>
This is a long story, but since you asked: About a year ago I wanted to
install and use Text::Iconv. (I am on Windows XP and Perl 5.61)
First I tried Active-state's Text-Iconv.zip and got:
D:\aa>ppm install Text-Iconv.ppd
Installing package 'Text-Iconv.ppd'...
Error installing package 'Text-Iconv.ppd': Read a PPD for 'Text-Iconv
it is not intended for this build of Perl (MSWin32-x86-multi-thread)
Then I read the POD for Text-iconv.tar.gz from CPAN
But it says: This is just a wrapper to access the system convert
libraries. This module provides a Perl interface to the iconv() codeset
conversion function, as defined by the Single UNIX Specification. For
more details see the POD documentation embedded in the file Iconv.pm,
which will also be installed as Text::Iconv(3) man page.
It is also possible to use a separate iconv library such as GNU libiconv
package, just make sure that the desired library is found
(see <http://www.gnu.org/directory/localization/libiconv.html>).
Of course I could have tried older versions of AC's Text-Iconv.zip,
searching for one suitable for Windows. But I came to the conclusion
that Text-Iconv.zip is not suitable for Windows and started to explore
other routes...
Fred
------------------------------
Date: Sun, 25 Dec 2005 10:53:45 -0500
From: "Daniel Kaplan" <NoSPam@NoSpam.com>
Subject: Re: Exiting without printing
Message-Id: <1135526036.275536@nntp.acecape.com>
"Joe Smith" <joe@inwap.com> wrote in message
news:rLGdnerGMaHDPDbeRVn-tg@comcast.com...
> That is CGI syntax. If you invoke the app from a browser, that
> is required. If you invoke the app from a cron job, that is not
> required. If you invoke the app via the web server when there
> is no browser in the picture, then you have the problem of
> over complicating things, making it difficult on yourself.
Curious then, I converted my CRON job scripts by removing all CGI related
matters, and replacing them with plain old print lines. Curious, since this
will be just a CRON job, should I remove those print statements. I mean, no
one sees them in the end.
Thanks ahead,
Daniel
------------------------------
Date: Sun, 25 Dec 2005 10:14:19 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: How to automatically submit html for data?
Message-Id: <43ae62de$0$29222$8fcfb975@news.wanadoo.fr>
Fred wrote:
> We have an html page at work that we can access to allow
> us temporary access through the firewall. This is fine
> from a workstation, but we need to do this on some Unix
> servers as well. Is there any way with perl I could
> generate the page below, and perform the submit, using
> a perl script? This particular html page prompts for a
> user name, then the next page prompts for the password.
>
> -Thanks
>
<snip fairly normal form>
Check out
WWW::Mechanize
CPAN is your friend.
Mark
------------------------------
Date: Sun, 25 Dec 2005 07:33:48 -0500
From: Fred <itfred@cdw.com>
Subject: Re: How to automatically submit html for data?
Message-Id: <pan.2005.12.25.12.33.48.718639@cdw.com>
On Sun, 25 Dec 2005 10:14:19 +0100, Mark Clements wrote:
> WWW::Mechanize
Is there a perl module to turn lead into gold? <g>
-Thanks
------------------------------
Date: Sun, 25 Dec 2005 07:10:03 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to automatically submit html for data?
Message-Id: <slrndqt6hb.g56.tadmc@magna.augustmail.com>
Fred <itfred@cdw.com> wrote:
> Is there any way with perl I could
> generate the page below, and perform the submit, using
> a perl script?
You seem to have an imperfect understanding of the division
of labor between web servers and browsers.
There is no reason to "generate the page below", because that
is merely input to the browser, and (I think) you want to
do it in Perl without a browser.
So, what you really need to be able to do is to generate the
same HTTP request that a browser would generate from that
(filled in) form.
And yes, you can make Perl programs that "look like" browsers.
Did you check the Perl FAQ before posting to the Perl newsgroup?
perldoc -q html
How do I fetch an HTML file?
How do I automate an HTML form submission?
See also:
Web Scraping Proxy
http://www.research.att.com/~hpk/wsp/
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 25 Dec 2005 08:27:38 -0500
From: Fred <itfred@cdw.com>
Subject: Re: How to automatically submit html for data?
Message-Id: <pan.2005.12.25.13.27.38.93700@cdw.com>
On Sun, 25 Dec 2005 07:33:48 -0500, Fred wrote:
> WWW::Mechanize
Damn! I tried WWW::Mechanize and WWW::Mechanize::FormFiller,
but the URL involved is https://, and a certificate is
presented initially. These modules can't seem to get
past the SSL certificate.
------------------------------
Date: Sun, 25 Dec 2005 08:29:23 -0500
From: Fred <itfred@cdw.com>
Subject: Re: How to automatically submit html for data?
Message-Id: <pan.2005.12.25.13.29.21.553128@cdw.com>
On Sun, 25 Dec 2005 07:10:03 -0600, Tad McClellan wrote:
> Fred <itfred@cdw.com> wrote:
>
>
>> Is there any way with perl I could
>> generate the page below, and perform the submit, using
>> a perl script?
>
>
> You seem to have an imperfect understanding of the division
> of labor between web servers and browsers.
>
> There is no reason to "generate the page below", because that
> is merely input to the browser, and (I think) you want to
> do it in Perl without a browser.
>
> So, what you really need to be able to do is to generate the
> same HTTP request that a browser would generate from that
> (filled in) form.
>
>
> And yes, you can make Perl programs that "look like" browsers.
>
> Did you check the Perl FAQ before posting to the Perl newsgroup?
>
> perldoc -q html
>
> How do I fetch an HTML file?
>
> How do I automate an HTML form submission?
>
>
> See also:
>
> Web Scraping Proxy
>
> http://www.research.att.com/~hpk/wsp/
Another poster suggested WWW::Mechanize and WWW::Mechanize::FormFiller,
which seems to work well as long as there are no SSL certificates
involved. Unfortunately, the form I'm trying to automatically
submit the data for is an https:// URL, and you are first
presented with an SSL cert.
------------------------------
Date: Sun, 25 Dec 2005 14:06:56 +0000
From: Brian Wakem <no@email.com>
Subject: Re: How to automatically submit html for data?
Message-Id: <417nc0F1agmstU1@individual.net>
Fred wrote:
> On Sun, 25 Dec 2005 07:33:48 -0500, Fred wrote:
>
>> WWW::Mechanize
>
>
> Damn! I tried WWW::Mechanize and WWW::Mechanize::FormFiller,
> but the URL involved is https://, and a certificate is
> presented initially. These modules can't seem to get
> past the SSL certificate.
Simply 'use Crypt::SSLeay'
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
------------------------------
Date: Sun, 25 Dec 2005 15:57:30 GMT
From: "John W. Burns" <vzeo882n@verizon.net>
Subject: not a valid win32 application
Message-Id: <Kjzrf.363$SW3.352@trndny08>
For some inexplicable reason (at least to me) my windows perl application
has ceased to load.
When I call perl\bin\perl.exe I receive the message "not a valid win32
application." OS is Windows XP.
I have never had this problem in the past. I re-installed Perl from Active
State and still receive the same
error message. Have searched Active State, CPAN, Monks, Microsoft, etc for
a fix and can't find one.
Any ideas on how to solve this problem? Many thanks.
JWB
------------------------------
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:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#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 V10 Issue 8796
***************************************