[31916] in Perl-Users-Digest
Perl-Users Digest, Issue: 3179 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 17 14:09:25 2010
Date: Sun, 17 Oct 2010 11:09:11 -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 Sun, 17 Oct 2010 Volume: 11 Number: 3179
Today's topics:
Re: a test posting <tadmc@seesig.invalid>
Re: FAQ 4.69 How can I make the Perl equivalent of a C <sherm.pendley@gmail.com>
Re: FAQ 4.69 How can I make the Perl equivalent of a C <brian.d.foy@gmail.com>
Re: Looping on "if" statement? sln@netherlands.com
Re: perl curl get data from website <emailsrvr-groups@yahoo.com>
Re: perl curl get data from website <sherm.pendley@gmail.com>
Re: perl curl get data from website <jurgenex@hotmail.com>
Re: perl curl get data from website <ben@morrow.me.uk>
Re: perl curl get data from website <emailsrvr-groups@yahoo.com>
Re: perl curl get data from website <tadmc@seesig.invalid>
Re: perl curl get data from website <nospam-abuse@ilyaz.org>
Re: where to install cpan modules <nospam-abuse@ilyaz.org>
Re: why does this happen? <whynot@pozharski.name>
Re: why does this happen? <whynot@pozharski.name>
Re: why does this happen? <hjp-usenet2@hjp.at>
Re: why does this happen? <hjp-usenet2@hjp.at>
Re: why does this happen? <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 Oct 2010 20:58:34 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: a test posting
Message-Id: <slrnibkm9c.ede.tadmc@tadbox.sbcglobal.net>
maus <greymausg@mail.com> wrote:
> On 2010-10-13, Ng Spim <ng@spim.woeishyang.com> wrote:
>> Pellentesque mollis imperdiet nibh, eu blandit nisi consequat et. Nulla
>> ullamcorper ullamcorper ante vel vehicula. Curabitur sit amet porta
>> est. Aliquam placerat lectus in mauris sagittis tempus. Cras vel ligula
>> eros. In vehicula auctor lacinia. Ut pretium ornare mauris at luctus.
>> Etiam sit amet scelerisque nunc. Phasellus ac urna vel sapien pretium
>> pharetra eu et dolor. Pellentesque blandit adipiscing diam egestas
>> cursus. Pellentesque in orci justo.
>
>
> alt.test
This OP is not a simple noob.
It is a spammer:
http://groups.google.com/groups/search?as_uauthors=ng%40spim.woeishyang.com
--
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: Sun, 17 Oct 2010 00:08:47 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: FAQ 4.69 How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?
Message-Id: <m239s5mpf4.fsf@sherm.shermpendley.com>
PerlFAQ Server <brian@theperlreview.com> writes:
> References are documented in perlref and the upcoming perlreftut.
Every copy of Perl I have, back to 2003's 5.8.1, includes perlreftut -
we can probably get rid of the "upcoming" now. :-)
sherm--
--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
------------------------------
Date: Sat, 16 Oct 2010 23:45:36 -0500
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 4.69 How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?
Message-Id: <161020102345364325%brian.d.foy@gmail.com>
In article <m239s5mpf4.fsf@sherm.shermpendley.com>, Sherm Pendley
<sherm.pendley@gmail.com> wrote:
> PerlFAQ Server <brian@theperlreview.com> writes:
>
> > References are documented in perlref and the upcoming perlreftut.
>
> Every copy of Perl I have, back to 2003's 5.8.1, includes perlreftut -
> we can probably get rid of the "upcoming" now. :-)
fixed in ab093f19b906ca5bbd46a406b91acebad99a95ff
Thanks,
------------------------------
Date: Sat, 16 Oct 2010 21:16:14 -0700
From: sln@netherlands.com
Subject: Re: Looping on "if" statement?
Message-Id: <s6skb6dpt9pecgvn46ce3e3els09ivv1r3@4ax.com>
On Tue, 12 Oct 2010 05:39:14 -0700 (PDT), T <zihav@yahoo.com> wrote:
>Greetings,
>
> Just wanted to place an update in case someone else runs into this
>problem. It appears to be a Redhat 5.5 issues with the following bit
>of code and XML:
>
> grep{m/[<>]/ } @out
>
>@out contains the XML output from a AccuRev CLI command. Here's what
>we found:
>
>grep { m/<>/ } @array
>* infinite loop only when run on RH5.5 in the overall context of of
>our program
>* when run by itself in a test program with the same data, it’s fine,
>and also runs fine
>* in the context of the perl debugger.
>
>grep m/<>/, @array * works as expected
>
>We've switch to the second, Not sure why RH5.5 has this problem. Hope
>this helps someone else.
>
> Thanks for the help
> Tom
Saw this the other day, been thinking about it.
Does:
grep{m/[<>]/ } @out
sound like the most innacuous bit of common Perl code compiled
with the same standard library calls that should span at least
more than one minor revisions of the same OS? If not, problems at
that level, perl won't run.
Of course perl for [your OS] must be compiled with proper headers
and libs. This includes any modules your application uses, in the
case where the module distribute custom binary.
In the case where you have xml chopped up in a @out array,
that won't cause any problem.
use strict;
use warnings;
my @out = split "\n", <<EXML;
>>>>>>>>>>>>>>><<<<<<<<<<<root>
<root><root>
<root>
EXML
my ($mode, $res, $xml) = (1, 0, \'xml');
if ( ($mode == 2 || ($mode == 1 && !$res)) &&
ref $xml &&
scalar grep{ /[<>]/ }@out )
{
print "works on windows\n";
}
print "done, found ", (scalar grep{ m/[<>]/ } @out), "\n";
__END__
-sln
------------------------------
Date: Sat, 16 Oct 2010 20:31:43 -0700 (PDT)
From: SVCitian <emailsrvr-groups@yahoo.com>
Subject: Re: perl curl get data from website
Message-Id: <b5be858d-9678-411a-96d1-e910aabdee2f@e34g2000prn.googlegroups.com>
On Oct 16, 9:28=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> SVCitian <emailsrvr-gro...@yahoo.com> wrote:
> >These 3 URLs work on a browser.. and return the same results... both
> >Firefox and IE.
>
> >But, I want to retrieve this programmatically using curl or perl..
> >with the prefix and sn serial number changed each time... How can i
> >make it work..
>
> >Can you provide a simple curl command line .. or perl get http.. to
> >demonstrate the retrieval.. thanks.
>
> See the FAQ: perldoc -q "HTML file"
> =A0 =A0 =A0 =A0 "How do I fetch an HTML file?"
>
> jue
Actually i know how to use curl with in perl or use perl html
commands.
But, the problem is the above URL doesn't work even in the simplest
case of:
curl "http://www.google.com/url?sa=3DD&q=3Dhttp://
www.bangkokflightservices.com/our_cargo_track%26trace.php%3Fm_prefix%3D176%=
26m_sn%3D75064953%26h_prefix%3DHWB%26h_sn%3D&usg=3DAFQjCNFh02ikp7CSs9lxi_S7=
ec0Edw9m5g"
I even tried to user "tamper data" firefox add to get behind the
scenes of GET, POST, etc... but I can't proceed any further than the
URLs given above.
why? that may be something to do with ajax, cookie, user agent, or
whatever. I have tried some combinations, but none works.
It works on the browser just right out of the box.. even changing the
prefix and serial numbers.
So, i want to find out what i am missing that hinders the data
retrieval.
------------------------------
Date: Sat, 16 Oct 2010 23:52:09 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: perl curl get data from website
Message-Id: <m2r5fpscgm.fsf@sherm.shermpendley.com>
SVCitian <emailsrvr-groups@yahoo.com> writes:
> Actually i know how to use curl with in perl or use perl html
> commands.
>
> But, the problem is the above URL doesn't work even in the simplest
> case of:
>
> curl "http://www.google.com/url?sa=D&q=http://www.bangkokflightservices.com/our_cargo_track%26trace.php%3Fm_prefix%3D176%26m_sn%3D75064953%26h_prefix%3DHWB%26h_sn%3D&usg=AFQjCNFh02ikp7CSs9lxi_S7ec0Edw9m5g"
>
Define "doesn't work." When I tried the exact command above, I got the
same response from the server that FireFox got - a page with some Java-
Script that loads another page in a popup. (Or rather, it would have
done so in FF, if I hadn't been using a popup blocker - but that's
neither here nor there.)
Were you expecting Curl or Perl to run the JS, or maybe even to open
the popup window? If so, you've set your expectations too high. Neither
one will run the JS, so you'll need to take a look at that and write the
equivalent functionality into your script.
sherm--
--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
------------------------------
Date: Sat, 16 Oct 2010 21:56:54 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: perl curl get data from website
Message-Id: <460lb6142aj9b33v5lal55hig55k5mgn1l@4ax.com>
SVCitian <emailsrvr-groups@yahoo.com> wrote:
>But, the problem is the above URL doesn't work even in the simplest
>case of:
>
>curl "http://www.google.com/url?sa=D&q=http://
>www.bangkokflightservices.com/our_cargo_track%26trace.php%3Fm_prefix%3D176%26m_sn%3D75064953%26h_prefix%3DHWB%26h_sn%3D&usg=AFQjCNFh02ikp7CSs9lxi_S7ec0Edw9m5g"
>
>I even tried to user "tamper data" firefox add to get behind the
>scenes of GET, POST, etc... but I can't proceed any further than the
>URLs given above.
An HTTP request using that URL above returns
<!-- This page yong codeing. Please don't copy idea or code before owne
argee. if you copy this code than see it's you code and you project. you
is fucking man -->
<script> window.open
('http://www.bangkokflightservices.com/our_cargo_track.php') ;
setTimeout("window.close();", 10);
</script>
Were you expecting something different?
>It works on the browser just right out of the box.. even changing the
>prefix and serial numbers.
Please define "works"/"doesn't work".
I am getting just a blank page (FireFox 3.6.8; yeah, I am going to
update now) which is not surprising given the HTTP response above.
To me that is "doesn't work", but of course YMMV.
>So, i want to find out what i am missing that hinders the data
>retrieval.
Are you getting something different from your script?
jue
------------------------------
Date: Sun, 17 Oct 2010 08:25:58 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perl curl get data from website
Message-Id: <61lqo7-9a2.ln1@osiris.mauzo.dyndns.org>
Quoth Sherm Pendley <sherm.pendley@gmail.com>:
>
> Were you expecting Curl or Perl to run the JS, or maybe even to open
> the popup window? If so, you've set your expectations too high. Neither
> one will run the JS, so you'll need to take a look at that and write the
> equivalent functionality into your script.
WWW::Selenium is non-trivial to set up, but works extremely well.
WWW::Scripter looks a little alpha, but might work.
Ben
------------------------------
Date: Sun, 17 Oct 2010 07:19:22 -0700 (PDT)
From: SVCitian <emailsrvr-groups@yahoo.com>
Subject: Re: perl curl get data from website
Message-Id: <9e5b92ef-7a15-4e7e-ba96-17eb099281d7@9g2000prn.googlegroups.com>
On Oct 17, 11:56=A0am, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> SVCitian <emailsrvr-gro...@yahoo.com> wrote:
> >But, the problem is the above URL doesn't work even in the simplest
> >case of:
>
> >curl "http://www.google.com/url?sa=3DD&q=3Dhttp://
> >www.bangkokflightservices.com/our_cargo_track%26trace.php%3Fm_prefix%...=
"
>
> >I even tried to user "tamper data" firefox add to get behind the
> >scenes of GET, POST, etc... but I can't proceed any further than the
> >URLs given above.
>
> An HTTP request using that URL above returns
>
> <!-- =A0This page yong codeing. Please don't copy idea or code before own=
e
> argee. if you copy this code than see it's you code and you project. you
> is fucking man =A0-->
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <script> window.open
> ('http://www.bangkokflightservices.com/our_cargo_track.php') ;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 setTimeout("window.close(=
);", 10);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </script>
>
> Were you expecting something different?
>
> >It works on the browser just right out of the box.. even changing the
> >prefix and serial numbers.
>
> Please define "works"/"doesn't work".
> I am getting just a blank page (FireFox 3.6.8; yeah, I am going to
> update now) which is not surprising given the HTTP response above.
>
> To me that is "doesn't work", but of course YMMV.
>
> >So, i want to find out what i am missing that hinders the data
> >retrieval.
>
> Are you getting something different from your script?
>
> jue
i am afraid we are not having the same response in our browsers.. due
to cookies or whatever.
Please try this,
shortened version: http://goo.gl/FlGU
full version:
http://www.google.com/url?sa=3DD&q=3Dhttp://www.bangkokflightservices.com/T=
rackTrace/showc_track.php%3Fm_prefix%3D176%26m_sn%3D75064953%26h_prefix%3DH=
WB%26h_sn%3D%26ecy%3De076438db64c6190f7b9689a379b7f7093368f1652d14db65fee1a=
b916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc072b=
1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9=
b3fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53f=
ea6af74be%26ch%3D%25A0%25A0%25A0%25A0&usg=3DAFQjCNHTMCnorOy2WILngV1qdOWYyp-=
gkg
what you expect to see is:
about 7 lines of some transaction records from 14/10/2010 05:37pm to
09:54pm.. if you don't get this result in your end then you will have
to start from scratch.. then i suggest you go to the
Homepage: http://www.bangkokflightservices.com/our_cargo_track.php
and put 176 - 75064953 in MAWB suffix and prefix and click "Search"
I want to get the exact same results of the resulting page through
curl or perl http.
It doesn't work for me.. when I put the above URL (this is how far I
have reached).. using
curl "... above url..."
but, it works for me in firefox with the same URL.
Let me know if you need more clarification.
Yes.. it returns this in some occasions... but this is not what i
expect.. i expect about 7 lines of transaction records. You will know
what I mean when you start from scratch with the URL above and put
prefix and suffix yourselves.
<!-- This page yong codeing. Please don't copy idea or code before
owne
argee. if you copy this code than see it's you code and you project.
you
is fucking man -->
Thanks.
------------------------------
Date: Sun, 17 Oct 2010 10:21:03 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: perl curl get data from website
Message-Id: <slrnibm5a7.g8u.tadmc@tadbox.sbcglobal.net>
SVCitian <emailsrvr-groups@yahoo.com> wrote:
> I even tried to user "tamper data" firefox add to get behind the
> scenes of GET, POST, etc... but I can't proceed any further than the
> URLs given above.
>
> why? that may be something to do with ajax, cookie, user agent, or
> whatever.
You might want to try it with the Web Scraping Proxy:
http://www2.research.att.com/sw/tools/wsp/
which is nice because it logs the traffic in the form of
Perl code that you can copy/paste/modify to suit your needs.
--
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: Sun, 17 Oct 2010 17:20:31 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: perl curl get data from website
Message-Id: <slrnibmc2v.jku.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-10-17, Tad McClellan <tadmc@seesig.invalid> wrote:
> You might want to try it with the Web Scraping Proxy:
>
> http://www2.research.att.com/sw/tools/wsp/
>
> which is nice because it logs the traffic in the form of
> Perl code that you can copy/paste/modify to suit your needs.
A username and password are being requested by
http://www2.research.att.com. The site says: "Enter Password"
Now what?
Ilya
------------------------------
Date: Sun, 17 Oct 2010 06:40:12 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: where to install cpan modules
Message-Id: <slrnibl6ib.ask.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-10-16, John Smith <john@example.invalid> wrote:
> Einstein defined insanity as doing the same thing repeatedly and
> expecting different results.
Each time I try to define insanity, I get different results... Now whta?
Ilya
------------------------------
Date: Sun, 17 Oct 2010 10:13:29 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: why does this happen?
Message-Id: <slrnibl8gg.84l.whynot@orphan.zombinet>
with <slrnibj5d0.ui6.hjp-usenet2@hrunkner.hjp.at> Peter J. Holzer wrote:
*SKIP*
> "You" is the impersonal you, not any specific contributor to this
> thread.
Thanks.
*SKIP*
> But the OP wasn't trying to do anything that fancy. He was opening a
> script he had written himself and was saving it under a different name
> in the same directory. I think it is very hard to argue that in this
> case the permissions should be different than the original.
Exactly. I think, that I would probably welcome 'cp' being more
restrictive. I'm regularly bitten by 'patch' unwilling to patch
unwritable files in just extracted tar-ball. And that makes sense for
me (on both sides of a problem). However all that clash is about other
thing.
I believe that OP has came from toy-OS world, where suffix bears meaning
of executability. All of a sudden it's irrelevant on that side of the
fence. And now there're GUI-addicts who scream "Let's Save-As make just
written files executable".
In fact, I don't have a clear understanding what that Save-As thingy is.
I have ':w' (writes the buffer back), ':w >>filename' (writes the buffer
with other filename), and ':w !cmd' (pipes the buffer to command).
Which one is Save-As? All of them are ':write' for me.
GUI-addicts are boring.
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Sun, 17 Oct 2010 10:14:11 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: why does this happen?
Message-Id: <slrnibl8hp.84l.whynot@orphan.zombinet>
with <8g7f0bFp1gU1@mid.individual.net> Uno wrote:
> Hello newsgroups,
What a fscking troll you are.
*CUT*
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Sun, 17 Oct 2010 15:49:11 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: why does this happen?
Message-Id: <slrniblvmr.thh.hjp-usenet2@hrunkner.hjp.at>
On 2010-10-16 14:34, Jürgen Exner <jurgenex@hotmail.com> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>>There is also the problem that if you copy a file from one directory to
>>the other there are at least two sane assumptions of what you want to
>>achieve:
>>
>> 1) You want to preserve the original permissions. If access to the
>> original file was restricted, it was for a reason, and the copy (having
>> the same contents) should have the same restrictions.
>
> I disagree. One of the most frequent reasons to copy a file is to create
> a private copy which can be amended and modified by me,
That's why I wrote that there are "at least two sane assumptions". Your
reason is the second reason I explicitely mentioned, but which you
didn't quote. Did you remove it on purpose just so that you could
disagree or were you just unable to read the third short paragraph
before hitting the followup key?
hp
------------------------------
Date: Sun, 17 Oct 2010 15:58:20 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: why does this happen?
Message-Id: <slrnibm07u.thh.hjp-usenet2@hrunkner.hjp.at>
On 2010-10-17 07:13, Eric Pozharski <whynot@pozharski.name> wrote:
> In fact, I don't have a clear understanding what that Save-As thingy is.
> I have ':w' (writes the buffer back), ':w >>filename' (writes the buffer
> with other filename), and ':w !cmd' (pipes the buffer to command).
> Which one is Save-As? All of them are ':write' for me.
You forgot ':w filename', which is likely what the OP meant if he's
using a vi clone. If he's using vim in particular, he might have meant
':saveas filename' which is like ':w filename' followed by ':r filename'.
I was taking "Save as" (did he even use that term? I don't remember) as
a generic name for the editor's "save the current buffer under a
different file name" functionality. Since that functionality is common
to just about every editor I've used in the past 25 years I don't see
much value in bringing editor-specific commands into the discussion.
hp
------------------------------
Date: Sun, 17 Oct 2010 09:17:53 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: why does this happen?
Message-Id: <hb8mb6pe9b8j5pa01d26rn98bek38s6pbt@4ax.com>
"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>On 2010-10-16 14:34, Jürgen Exner <jurgenex@hotmail.com> wrote:
>> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>>>There is also the problem that if you copy a file from one directory to
>>>the other there are at least two sane assumptions of what you want to
>>>achieve:
>>>
>>> 1) You want to preserve the original permissions. If access to the
>>> original file was restricted, it was for a reason, and the copy (having
>>> the same contents) should have the same restrictions.
>>
>> I disagree. One of the most frequent reasons to copy a file is to create
>> a private copy which can be amended and modified by me,
>
>That's why I wrote that there are "at least two sane assumptions". Your
>reason is the second reason I explicitely mentioned, but which you
>didn't quote. Did you remove it on purpose just so that you could
>disagree or were you just unable to read the third short paragraph
>before hitting the followup key?
Neither, nor. I was unable to _understand_ what you were trying to say
in that paragraph.
jue
------------------------------
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 3179
***************************************