[30501] in Perl-Users-Digest
Perl-Users Digest, Issue: 1744 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 24 03:09:45 2008
Date: Thu, 24 Jul 2008 00:09:08 -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 Thu, 24 Jul 2008 Volume: 11 Number: 1744
Today's topics:
Re: C linked lists in Perl (aka ? the Platypus)
Re: C linked lists in Perl <joost@zeekat.nl>
Date format <calvin.chan.cch@gmail.com>
Re: Date format <noreply@gunnar.cc>
Re: Date format <c.groner@gmail.com>
Re: FAQ 3.14 How can I write a GUI (X, Tk, Gtk, etc.) i <mjcarman@mchsi.com>
Re: FAQ 4.2 Why is int() broken? <szrRE@szromanMO.comVE>
How do I PUSH an HTTP::POST using perl LWP? joemacbusiness@gmail.com
Re: How do I PUSH an HTTP::POST using perl LWP? <ben@morrow.me.uk>
Re: Mail::IMAPClient usage... <yogeshkagrawal@gmail.com>
new CPAN modules on Thu Jul 24 2008 (Randal Schwartz)
Re: PAR packer Error <ezraroi@gmail.com>
Re: PAR packer Error <ben@morrow.me.uk>
Re: Perl - approach to query https website for code & p (Zak B. Elep)
Re: Perl - approach to query https website for code & p (Zak B. Elep)
Perl - approach to query https website for code & parsi deepalicanada@gmail.com
Re: Perl - approach to query https website for code & p <deepalicanada@gmail.com>
Re: Undefined behaviour <joost@zeekat.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Jul 2008 21:18:08 GMT
From: "David Formosa (aka ? the Platypus)" <dformosa@usyd.edu.au>
Subject: Re: C linked lists in Perl
Message-Id: <slrng8f96n.3la.dformosa@localhost.localdomain>
On Tue, 22 Jul 2008 10:25:22 -0700, szr <szrRE@szromanMO.comVE> wrote:
[...]
>> $tail = ($tail->[1] = [$_]);
> ^^^^^^^^^^^^^^^^^^^^^
>
> Is it any surprise that it segfaults when you're using a construct with
> undefined behavior?
This is not C, the behavour of this construct is perfectly defined.
------------------------------
Date: Thu, 24 Jul 2008 01:05:47 +0200
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: C linked lists in Perl
Message-Id: <877ibc5hh0.fsf@zeekat.nl>
"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
> On 2008-07-22 18:16, xhoster@gmail.com <xhoster@gmail.com> wrote:
>> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>>> who in his right mind builds datastructures with 100000 nesting
>>> levels?
>>
>> Someone trying to implement a large linked list, for one, or course.
>
> However, why would someone do this in Perl? Which problem would be
> better solved by a singly linked list than an array in Perl? It just
> seems to be unidiomatic.
It's definitely unidiomatic, but linked lists (especially large linked
lists) are a conceptually simple way of dealing with certain problems
that large arrays have (like splicing). Having the GC take so much
memory more or less forces the programmer to either use an XS-based
linked list, or a mixed linked-list/array solution. And neither are as
easy to do correctly as a simple linked list.
IMHO having built-in linked lists would be a good thing. But I'm sure
there's a CPAN solution somewhere.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
Date: Wed, 23 Jul 2008 15:34:52 -0700 (PDT)
From: cc96ai <calvin.chan.cch@gmail.com>
Subject: Date format
Message-Id: <522c892b-4fa9-4207-a4ab-c67ee8ab8f56@f1g2000prb.googlegroups.com>
I want to change the date format in perl script
input: "2005-11-01"
output:November 1, 2005
thanks
------------------------------
Date: Thu, 24 Jul 2008 01:44:28 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Date format
Message-Id: <6eptvdF7p33pU1@mid.individual.net>
cc96ai wrote:
> I want to change the date format in perl script
>
> input: "2005-11-01"
> output:November 1, 2005
The POSIX::strftime() function may be helpful.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 23 Jul 2008 17:01:34 -0700
From: Carl <c.groner@gmail.com>
Subject: Re: Date format
Message-Id: <878wvscfq9.fsf@gmail.com>
cc96ai <calvin.chan.cch@gmail.com> writes:
> I want to change the date format in perl script
>
> input: "2005-11-01"
> output:November 1, 2005
>
> thanks
You might be interested in the Date::Simple module:
--example--
$ cat test.pl
#!/usr/bin/perl
use strict;
use warnings;
use Date::Simple qw/date/;
my $d = date('2005-11-01');
print $d->format('%B %d, %Y'), "\n";
__END__
$ ./test.pl
November 01, 2005
$
--end example--
See:
http://search.cpan.org/dist/Date-Simple/lib/Date/Simple.pm
Hope that helps,
Carl.
------------------------------
Date: Thu, 24 Jul 2008 02:00:33 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: FAQ 3.14 How can I write a GUI (X, Tk, Gtk, etc.) in Perl?
Message-Id: <5nRhk.212335$TT4.159434@attbi_s22>
PerlFAQ Server wrote:
> 3.14: How can I write a GUI (X, Tk, Gtk, etc.) in Perl?
There's a new GUI toolkit on the block:
Tkx
This is another binding to Tk. Unlike Perl/Tk (which replaced the
Tcl layer with Perl) Tkx provides a bridge to Tcl. This means that
you get direct access to everything that Tcl/Tk supports and the
behavior described in the Tcl documentation. The Tkx documentation
only describes the bridge; you'll need to read the Tcl/Tk
documentation for everything else. Recent versions of Tcl/Tk include
tiled (themed) widgets. This allows a mostly platform native look
without sacrificing portability.
There's also Tcl::Tk, which uses the same Tcl bridge as Tkx but provides
a syntax closer to that used by Perl/Tk. It doesn't seem to be mature
enough for general use yet, though, and as such probably shouldn't be
mentioned here.
It might be worth noting that as of v5.10 ActivePerl ships with Tkx but
no longer ships with Perl/Tk. (It's easier to distribute an app if there
are fewer dependencies that need to be installed.)
-mjc
------------------------------
Date: Wed, 23 Jul 2008 13:23:19 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <g683vn051j@news4.newsguy.com>
Tad J McClellan wrote:
> szr <szrRE@szromanMO.comVE> wrote:
>> PerlFAQ Server wrote:
[...]
>>> 4.2: Why is int() broken?
>>>
>>> Your "int()" is most probably working just fine. It's the numbers
>>> that aren't quite what you think.
>>>
>>> First, see the answer to "Why am I getting long decimals (eg,
>>> 19.9499999999999) instead of the numbers I should be getting (eg,
>>> 19.95)?".
>>
>> Maybe I'm just tired, but where exactly do you get these particular
>> rounding errors, as I cannot reproduce them:
>>
>> $ perl5.10.0 -e 'print 19.95, qq{\n};'
>> 19.95
>
> You are not outputting with enough precision to see the difference.
>
> Try:
>
> perl5.10.0 -e 'printf "%30.20f\n", 19.95'
Indeed, this gives me: " 19.95000000000000000069".
Note that the "30" in "%30.20f\n" isn't needed. That just sets the
minumum field width.
>> $ perl5.6.1 -e 'print int(0.6/0.2-2), qq{\n};'
>
>>> What you think in the above as 'three' is really more like
>>> 2.9999999999999995559.
>>
>> $ perl5.10.0 -e 'print 3.0, qq{\n};'
>> 3
>
> perl -e 'printf "%30.20f\n", (0.6/0.2)'
it seems the results of that are not uniform:
$ perl5.10.0 -e 'printf "%30.20f\n", (0.6/0.2)'
3.00000000000000000000
$ perl5.8.8 -e 'printf "%30.20f\n", (0.6/0.2)'
3.00000000000000000000
$ perl5.8.2 -e 'printf "%30.20f\n", (0.6/0.2)'
2.99999999999999955591
$ perl5.8.0 -e 'printf "%30.20f\n", (0.6/0.2)'
2.99999999999999955591
$ perl5.6.1 -e 'printf "%30.20f\n", (0.6/0.2)'
2.99999999999999955591
>> I would of expected some rounding errors, but this works on all the
>> Perl
>
> s/would of/would've/
> or
> s/would of/would have/
What is it with you and typos? I was rather tired when composing that
post so excuse me for not having perfect grammar.
>> Again I am a bit tired from a long trip
>
> That could explain the multiple reveals seen recently.
I'm not sure what you are getting at here. It's just a typing error, one
which is made daily by an awful lot of people.
--
szr
------------------------------
Date: Wed, 23 Jul 2008 15:26:05 -0700 (PDT)
From: joemacbusiness@gmail.com
Subject: How do I PUSH an HTTP::POST using perl LWP?
Message-Id: <ce78b3ed-6941-4796-b4d9-dde99d19bab1@k36g2000pri.googlegroups.com>
Hi All,
I want to use http POST to push several gzipped files
to another apache server. We need to use this since our
customers only allow access to port 80, so no ssh and no ftp.
I am using perl LWP modules for this.
The problem is that it seems like the POST works like a get (pull)
when I really want it to *push* the many *gz files to another
host.
Here is the code I have so far. This POST works like a "get".
========================= snip =========================
use HTTP::Request::Common qw(POST);
use LWP 5.64; # get the most recent stuff.
$ua = LWP::UserAgent->new;
#########################################################
# this builds a list of files that need to be transferred.
# it creates a local file: /tmp/zipped.list
#########################################################
#
my $req = HTTP::Request->new(POST => 'http://somehostname.company.com/
~user/zipped.list');
$req->content_type('text');
open(F,">/tmp/zipped.list") || print "cannot open /tmp/zipped.list";
#binmode F;
print F $ua->request($req)->content;
close(F);
#########################################################
# this loops through the list and (supposedly) copies the
# files **to** the desthost (ie a push).
# But it really pulls the files down from the desthost
# I want it to push the files to desthost.
#########################################################
#
my $infile = "/tmp/zipped.list";
open(FILELIST,"$infile") || print "cannot open $infile $!";
my @filearray = <FILELIST>;
close(FILELIST);
chdir("/tmp/shipping");
my $pwd = `pwd`;
print " ================================ working directory = $pwd \n";
foreach my $fname (@filearray){
chomp($fname);
print "transferring $fname .... \n";
my $req = HTTP::Request->new(POST => "http://desthost.company2.com/
~user/$fname");
$req->content_type('application/gzip');
open(F,">/tmp/shipping/$fname") || print "cannot open /tmp/
shipping/$fname";
binmode F;
print F $ua->request($req)->content;
close(F);
}
========================= end snip ======================
How do I make the code PUSH the gzipped files to desthost?
This assumes that I have permission on desthost for ~user, which I do.
Any help would be appreciated,
Thanks, Joe M.
------------------------------
Date: Thu, 24 Jul 2008 00:17:13 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How do I PUSH an HTTP::POST using perl LWP?
Message-Id: <poqkl5-0uj.ln1@osiris.mauzo.dyndns.org>
Quoth joemacbusiness@gmail.com:
>
> I want to use http POST to push several gzipped files
> to another apache server. We need to use this since our
> customers only allow access to port 80, so no ssh and no ftp.
What do you have running on the server end (that is, the host you are
POSTing to)? What have you set up to handle the POST requests?
Note that you can't just POST to some random URL and expect it to
overwrite the file at that URL. Firstly, that would be a huge security
hole; secondly, the HTTP method for doing that is PUT, not POST; and
thirdly, unless you've installed something like WebDAV at the receiving
end Apache won't be willing to honour the request.
> I am using perl LWP modules for this.
> The problem is that it seems like the POST works like a get (pull)
> when I really want it to *push* the many *gz files to another
> host.
POST sends some data to the remote end, and then gets a reply.
> Here is the code I have so far. This POST works like a "get".
>
> ========================= snip =========================
>
> use HTTP::Request::Common qw(POST);
> use LWP 5.64; # get the most recent stuff.
> $ua = LWP::UserAgent->new;
>
> #########################################################
> # this builds a list of files that need to be transferred.
> # it creates a local file: /tmp/zipped.list
> #########################################################
> #
> my $req = HTTP::Request->new(POST => 'http://somehostname.company.com/
> ~user/zipped.list');
> $req->content_type('text');
Is this supposed to be a push or a pull of zipped.list? If it's supposed
to be a push, then you need to set $req->content. Otherwise, nothing
will get sent.
Also, 'text' is not a valid Content-Type. You probably mean
'text/plain', and you should specify a charset.
> open(F,">/tmp/zipped.list") || print "cannot open /tmp/zipped.list";
Use lexical filehandles.
Use 3-arg open.
Include the reason the open failed in the error message.
Errors should go to STDOUT, and unless you have some more sophisticated
error-handling, should 'die'.
You name that file at least three times: anything you name more than
once should go in a variable.
my $ZIPLIST = '/tmp/zipped.list';
open(my $F, '>', $ZIPLIST) || die "cannot open $ZIPLIST: $!";
> #binmode F;
> print F $ua->request($req)->content;
> close(F);
Again, are you pushing or pulling zipped.list? If you're trying to push
it, why are you opening the local copy for writing?
> #########################################################
> # this loops through the list and (supposedly) copies the
> # files **to** the desthost (ie a push).
> # But it really pulls the files down from the desthost
> # I want it to push the files to desthost.
> #########################################################
> #
>
> my $infile = "/tmp/zipped.list";
> open(FILELIST,"$infile") || print "cannot open $infile $!";
> my @filearray = <FILELIST>;
> close(FILELIST);
You've just written this data out. Keep hold of it rather than reading
it back in again.
> chdir("/tmp/shipping");
> my $pwd = `pwd`;
use Cwd qw/cwd/;
my $pwd = cwd;
> print " ================================ working directory = $pwd \n";
> foreach my $fname (@filearray){
> chomp($fname);
'chomp' is not usually the right tool for stripping newlines from
something received from the network. Typically, data received from the
network has CRLF line endings, and unless you've changed $/ chomp will
be removing LF only.
> print "transferring $fname .... \n";
>
> my $req = HTTP::Request->new(POST => "http://desthost.company2.com/
> ~user/$fname");
You will need a CGI (or some other form of server-side intelligence) set
up at this URL to handle the POST. Otherwise, Apache will just drop the
POSTed data on the floor and return the contents of the file.
> $req->content_type('application/gzip');
application/gzip is not a registered Content-Type. Either use
application/x-gzip or stick to application/octet-stream.
> open(F,">/tmp/shipping/$fname") || print "cannot open /tmp/
> shipping/$fname";
> binmode F;
> print F $ua->request($req)->content;
> close(F);
Again, I'm confused about whether you think you're pushing or pulling;
you're overwriting the local file, which suggests you're trying to pull.
If you want to push data you have to *read* from the local file and then
set $req->content to its contents *before* you make the request.
Ben
--
The Earth is degenerating these days. Bribery and corruption abound.
Children no longer mind their parents, every man wants to write a book,
and it is evident that the end of the world is fast approaching.
Assyrian stone tablet, c.2800 BC ben@morrow.me.uk
------------------------------
Date: Wed, 23 Jul 2008 22:06:52 -0700 (PDT)
From: Yogi <yogeshkagrawal@gmail.com>
Subject: Re: Mail::IMAPClient usage...
Message-Id: <c61d107e-e8c6-4dd7-85da-dc87d85ec5e8@u6g2000prc.googlegroups.com>
On Jul 23, 7:52=A0pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Tue, 22 Jul 2008 06:55:08 -0700 (PDT) Yogi <yogeshkagra...@gmail.com> =
wrote:
>
> Y> On Jul 22, 6:22=A0pm, Ted Zlatanov <t...@lifelogs.com> wrote:
>
> >> ...he could also use GMail's IMAP services.
>
> >> GMail IMAP, incidentally, implements a very basic subset of IMAP, but
> >> it's probably enough for the OP.
>
> Y> Hi Ted n Rick,
> Y> Thanks for your response on this. But even this is not working.
>
> Y> my $pop =3D new Mail::POP3Client( USER =A0 =A0 =3D> 'myid',
> Y> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PASSWOR=
D =3D> 'mypwd',
> Y> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0HOST =
=A0 =A0 =3D> "pop.gmail.com:995",
> Y> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0USESSL =
=3D> 1,
> Y> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DEBUG =
=3D> 1
> Y> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0) || die("E=
rror here $@");
>
> My suggestion is to:
>
> 1) enable IMAP on GMail (it's in the account settings, including server n=
ame)
> 2) use Mail::IMAPClient
>
> Ted
Hi Ted,
I did enable IMAP setting in my Gmail but was facing same issue. I
found that there are some issues with SSL installation. I was tied up
with some other work last night and hence could not work on this.
will resolve SSL issues and will try again.
Really, this is the best place to learn things. Thank you all.
Regards,
------------------------------
Date: Thu, 24 Jul 2008 04:42:21 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jul 24 2008
Message-Id: <K4HuEL.1EnJ@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-StringFormat-0.02
http://search.cpan.org/~gfuji/Acme-StringFormat-0.02/
Smart interface to sprintf()
----
Bundle-DBD-PO-0.03
http://search.cpan.org/~steffenw/Bundle-DBD-PO-0.03/
A bundle to install all DBD::PO related modules
----
Catalyst-Controller-DBIC-API-1.001000
http://search.cpan.org/~lsaunders/Catalyst-Controller-DBIC-API-1.001000/
----
Catalyst-Controller-FlashRemoting-0.01
http://search.cpan.org/~typester/Catalyst-Controller-FlashRemoting-0.01/
Catalyst controller for Flash Remoting
----
ClearPress-174
http://search.cpan.org/~rpettett/ClearPress-174/
Simple, fresh & fruity MVC framework
----
Coro-4.745
http://search.cpan.org/~mlehmann/Coro-4.745/
coroutine process abstraction
----
DBD-PO-0.03
http://search.cpan.org/~steffenw/DBD-PO-0.03/
DBI driver for PO files
----
Data-AMF-0.01001
http://search.cpan.org/~typester/Data-AMF-0.01001/
serialize / deserialize AMF data
----
Data-Visitor-Encode-0.10000
http://search.cpan.org/~dmaki/Data-Visitor-Encode-0.10000/
Encode/Decode Values In A Structure
----
Devel-FindBlessedRefs-1.1.2
http://search.cpan.org/~jettero/Devel-FindBlessedRefs-1.1.2/
find all refs blessed under a package
----
Device-USB-PanicButton-0.04
http://search.cpan.org/~bkendi/Device-USB-PanicButton-0.04/
interface to USB Panic Button
----
File-Assets-0.060_7
http://search.cpan.org/~rkrimen/File-Assets-0.060_7/
Manage .css and .js assets in a web application
----
File-Tee-0.05
http://search.cpan.org/~salva/File-Tee-0.05/
replicate data sent to a Perl stream
----
GD-Convert-2.14
http://search.cpan.org/~srezic/GD-Convert-2.14/
additional output formats for GD
----
Getopt-Modular-0.02
http://search.cpan.org/~dmcbride/Getopt-Modular-0.02/
Modular access to Getopt::Long
----
GraphViz-Makefile-1.16
http://search.cpan.org/~srezic/GraphViz-Makefile-1.16/
Create Makefile graphs using GraphViz
----
Math-Symbolic-Custom-Transformation-2.01
http://search.cpan.org/~smueller/Math-Symbolic-Custom-Transformation-2.01/
Transform Math::Symbolic trees
----
Mewsoft-Pagination-0.10
http://search.cpan.org/~mewsoft/Mewsoft-Pagination-0.10/
Standalone Object-Oriented Efficient Data Pagination
----
Mouse-0.06
http://search.cpan.org/~sartak/Mouse-0.06/
Moose minus the antlers
----
Net-LDAP-Class-0.06
http://search.cpan.org/~karman/Net-LDAP-Class-0.06/
object-relational mapper for Net::LDAP
----
Net-SSLeay-1.34
http://search.cpan.org/~flora/Net-SSLeay-1.34/
Perl extension for using OpenSSL
----
POSIX-Regex-0.90.13
http://search.cpan.org/~jettero/POSIX-Regex-0.90.13/
OO interface for the gnu regex engine
----
Parse-Stallion-0.03
http://search.cpan.org/~arthur/Parse-Stallion-0.03/
Perl backtracking parser and resultant tree evaluator
----
Pugs-Compiler-Rule-0.33
http://search.cpan.org/~fglock/Pugs-Compiler-Rule-0.33/
Compiler for Perl 6 regexes
----
Sub-Called-0.03
http://search.cpan.org/~reneeb/Sub-Called-0.03/
get information about how the subroutine is called
----
Sys-Protect-0.01
http://search.cpan.org/~bradfitz/Sys-Protect-0.01/
deny a bunch of opcodes
----
Tkx-FindBar-0.01
http://search.cpan.org/~mjcarman/Tkx-FindBar-0.01/
Perl Tkx extension for an incremental search toolbar
----
VS-Chart-0.05
http://search.cpan.org/~claesjac/VS-Chart-0.05/
Simple module to create beautifully looking charts
----
Win32-IPHelper-0.06
http://search.cpan.org/~lmasara/Win32-IPHelper-0.06/
Perl wrapper for Win32 IP Helper functions and structures.
----
XML-Entities-0.0303
http://search.cpan.org/~sixtease/XML-Entities-0.0303/
Decode strings with XML entities
----
sapnwrfc-0.20
http://search.cpan.org/~piers/sapnwrfc-0.20/
SAP Netweaver RFC support for Perl
----
v6-0.024
http://search.cpan.org/~fglock/v6-0.024/
An experimental Perl 6 implementation
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Wed, 23 Jul 2008 22:38:13 -0700 (PDT)
From: Roi <ezraroi@gmail.com>
Subject: Re: PAR packer Error
Message-Id: <32510111-7f0c-41d9-ad27-386599c1c6d1@r35g2000prm.googlegroups.com>
On 23 =D7=99=D7=95=D7=9C=D7=99, 20:16, Ben Morrow <b...@morrow.me.uk> wrote=
:
> Quoth Roi <ezra...@gmail.com>:
>
> > Hello,
> > I am trying to make an exe file from a perl script file. I am using
> > ActiveState Perl 5.8.6 (Build 811) on Windows.
> > This is the lcommand that i am running and the error msg:
>
> > pp -o sp.exe spdisplaye.pl
> > Perl lib version (v5.8.6) doesn't match executable version (v5.8.8) at
> > C:/Perl/
> > ib/Config.pm line 32.
>
> What happens if you just run
>
> =C2=A0 =C2=A0 perl spdisplaye.pl
>
> ? It looks to me as though you've messed up your perl installation.
>
> Ben
>
> --
> BEGIN{*(=3Dsub{$,=3D*)=3Dsub{print@_};local($#,$;,$/)=3D@_;for(keys%{ #..=
.@morrow.me.uk
> $#}){/m/&&next;**=3D${$#}{$_};/(\w):/&&(&(($#.$_,$;.$+,$/),next);$/=3D=3D=
\$*&&&)(=C2=AD$;.$
> _)}};*_=3Dsub{for(@_){$|=3D(!$|||$_||&)(q) )));&((q:\:\::,q,,,\$_);$_&&&)=
("\n")}}}_
> $J::u::s::t, $a::n::o::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $,
Hi,
If I run perl spdisplaye.pl it is working... and i reinstalled the
ActiveState Perl recently
------------------------------
Date: Thu, 24 Jul 2008 07:55:01 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: PAR packer Error
Message-Id: <5jlll5-bl2.ln1@osiris.mauzo.dyndns.org>
[please don't quote signatures]
Quoth Roi <ezraroi@gmail.com>:
> On 23 יולי, 20:16, Ben Morrow <b...@morrow.me.uk> wrote:
> > Quoth Roi <ezra...@gmail.com>:
> >
> > > Hello,
> > > I am trying to make an exe file from a perl script file. I am using
> > > ActiveState Perl 5.8.6 (Build 811) on Windows.
> > > This is the lcommand that i am running and the error msg:
> >
> > > pp -o sp.exe spdisplaye.pl
> > > Perl lib version (v5.8.6) doesn't match executable version (v5.8.8) at
> > > C:/Perl/
> > > ib/Config.pm line 32.
> >
> > What happens if you just run
> >
> > perl spdisplaye.pl
> >
> > ? It looks to me as though you've messed up your perl installation.
>
> If I run perl spdisplaye.pl it is working... and i reinstalled the
> ActiveState Perl recently
OK, then, have you by any chance installed a PPM of PAR-Packer that was
intended for perl 5.8.8?
Can you confirm that
perl -ne"/V eq / and print" c:\perl\lib\Config.pm
prints
$^V eq v5.8.6
? Can you put this in a file parlv.pl
print "$^]\n";
and run both
parl parlv.pl
and
parldyn parlv.pl
? If they don't both print '5.008006' then your version of PAR::Packer
does not match your version of perl: I would suggest installing the
latest 5.8.8 from ActiveState.
Ben
--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
ben@morrow.me.uk
------------------------------
Date: Thu, 24 Jul 2008 13:03:44 +0800
From: zakame@zakame.net (Zak B. Elep)
Subject: Re: Perl - approach to query https website for code & parsing xml response
Message-Id: <m2od4n7u1b.fsf@zakame.net>
deepalicanada@gmail.com writes:
> I can do this query manually through browser but when I tried taking a
> shot through LWP, i got error that "Your browser sent a request that
> this server could not understand". I'm not sure whether i am using
> correct module/approach to solve this problem so help would be
> appreciated.
Just how exactly did you do the call through LWP? Did you use
LWP::UserAgent to request the XML? If so, you probably want to do this:
my $ua = LWP::UserAgent->new();
my $res = $ua->post( "https://target/s/endpoint", q => 'query-number' );
I also noticed that you're requesting via HTTPS. Do you also have the
corresponding module for SSL installed (Crypt::SSLeay)
--
Zak B. Elep
http://blog.zakame.net
------------------------------
Date: Thu, 24 Jul 2008 13:59:28 +0800
From: zakame@zakame.net (Zak B. Elep)
Subject: Re: Perl - approach to query https website for code & parsing xml response
Message-Id: <m24p6f4ybj.fsf@zakame.net>
deep <deepalicanada@gmail.com> writes:
> # Create a request
> my $req = new HTTP::Request GET => $url;
The above causes the succeeding $ua->request() to connect correctly to
your server via HTTPS but feeding it with a `POST
https://site/request/script', which is not what you expect. I guess
this is taken from the Crypt::SSLeay documentation; I tried this myself
and reproduced the same bad request, even with GET. :(
Why make the HTTP::Request when LWP::UserAgent can do it for you via
$ua->post()?
--
Zak B. Elep
http://blog.zakame.net
------------------------------
Date: Wed, 23 Jul 2008 21:25:42 -0700 (PDT)
From: deepalicanada@gmail.com
Subject: Perl - approach to query https website for code & parsing xml response
Message-Id: <88f9e4b6-e6ac-4d59-aa35-74672c95416e@q28g2000prh.googlegroups.com>
I am new to perl web programming. I have done perl scripting for unix
but none on webside.So not sure about what modules should i use to
query https website and parse xml response?
Problem - Trying to get a code from a https website
e.g. https://www.mytargetwebsite.com/servlet/Getcode.SendRequest?q=<QUERYNO>
Here <QUERYNO> is constant.
The website returns following response:
<Response timestamp="2 July, 2008 12:10 AM EDT">
<code> 9999999 </code>
</Response>
I can do this query manually through browser but when I tried taking a
shot through LWP, i got error that "Your browser sent a request that
this server could not understand". I'm not sure whether i am using
correct module/approach to solve this problem so help would be
appreciated.
Thanks,
Deep
------------------------------
Date: Wed, 23 Jul 2008 22:32:58 -0700 (PDT)
From: deep <deepalicanada@gmail.com>
Subject: Re: Perl - approach to query https website for code & parsing xml response
Message-Id: <22c9fa8a-b7f2-4a72-8cf6-a4b54ce3d00a@j7g2000prm.googlegroups.com>
I have the module installed. Here's the code with error.
use LWP::Debug qw(+);
use LWP::UserAgent;
use Crypt::SSLeay;
use URI;
$ENV{HTTPS_DEBUG} = 1;
my $url = URI->new('https://www.mytargetwebsite.com/servlet/
Getcode.SendRequest');
my $queryno = 999999;
$url->query_form('q' => $queryno);
print "\n $url \n";
my $ua = new LWP::UserAgent;
# Create a request
my $req = new HTTP::Request GET => $url;
# Pass request to the user agent and get a response back
my $res= $ua->request($req);
print "\nResult - $res->content";
print "\n Error - $res->status_line";
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST <deleted actual website> -
https://www.mytargetwebsite.com/servlet/Getcode.SendRequest&q=999999
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A
LWP::Protocol::collect: read 208 bytes
SSL3 alert read:warning:close notify
LWP::UserAgent::request: Simple response: Bad Request
------------------------------
Date: Thu, 24 Jul 2008 01:16:05 +0200
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: Undefined behaviour
Message-Id: <87zlo842fe.fsf@zeekat.nl>
"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
> On 2008-07-22 18:07, Joost Diepenmaat <joost@zeekat.nl> wrote:
>> "szr" <szrRE@szromanMO.comVE> writes:
>>
>>>> $tail = ($tail->[1] = [$_]);
>>> ^^^^^^^^^^^^^^^^^^^^^
>>>
>>> Is it any surprise that it segfaults when you're using a construct with
>>> undefined behavior?
>>
>> how is that behaviour undefined?
>
> perldoc perlop:
>
> Note that just as in C, Perl doesn’t define when the variable is
> incremented or decremented. You just know it will be done sometime
> before or after the value is returned. This also means that modifying a
> variable twice in the same statement will lead to undefined behaviour.
That specifically applies to constructs such as
$b = ++$a + ++$a;
*not* to the kind of construct I used above. Also note that I'm *not*
modifying any variable twice.
Also this may or may not be relevant (from the perlop chapter on assignment):
Unlike in C, the scalar assignment operator produces a valid
lvalue. Modifying an assignment is equivalent to doing the
assignment and then modifying the variable that was assigned
to.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
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 V11 Issue 1744
***************************************