[30851] in Perl-Users-Digest
Perl-Users Digest, Issue: 2096 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 3 03:14:42 2009
Date: Sat, 3 Jan 2009 00:14:32 -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 Sat, 3 Jan 2009 Volume: 11 Number: 2096
Today's topics:
Re: Script to insert data to a web page? <cjohnso9@amfam.com>
Re: Script to insert data to a web page? <cjohnso9@amfam.com>
Re: Script to insert data to a web page? <noreply@gunnar.cc>
Re: Script to insert data to a web page? <tadmc@seesig.invalid>
Re: Script to insert data to a web page? <news@lawshouse.org>
Re: Script to insert data to a web page? <news123@free.fr>
Re: Unit test that checks for "croak" <freesoft12@gmail.com>
Re: Why not Ruby? <don@geddis.org>
Re: Why not Ruby? <tim@burlyhost.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 2 Jan 2009 13:13:05 -0800 (PST)
From: Chad <cjohnso9@amfam.com>
Subject: Re: Script to insert data to a web page?
Message-Id: <2ddc255a-d267-4475-8a73-c1e9f234ef67@r36g2000prf.googlegroups.com>
On Jan 2, 2:40=A0pm, co...@riffraff.plig.net (Vicky Conlan) wrote:
> According to <cjohn...@amfam.com>:
>
> >> > Hi there,
> >> > I am a Perl novice and am looking for a simple script to access a we=
b
> >> > page, enter some data, and examine the response.
> (snip)
> >Wow, thanks for the quick response. I have a large list of objects
> >that I want to enter on a web page to see if they exist. So the basic
> >flow would be read file, send object name to the web page, hit search,
> >return the result.
>
> Sorry, just to get confirmation, cos I think I'm unsure what you're looki=
ng
> for - from your first post I thought you wanted something which would sca=
n
> a web page with a form in it, then fill in the form fields and submit; =
=A0from
> your second it sounded more like downloading the source and doing some ki=
nd
> of text search on it.
>
> (apologies if this sounds a bit of a daft question, my brain is still on
> holiday atm :-)
>
> --
Hi again,
I will read a value from an input file, input that to the web page,
and examine the result from the web.
------------------------------
Date: Fri, 2 Jan 2009 13:14:25 -0800 (PST)
From: Chad <cjohnso9@amfam.com>
Subject: Re: Script to insert data to a web page?
Message-Id: <25f414b1-703a-4e50-bacc-d0aca73b44da@q26g2000prq.googlegroups.com>
On Jan 2, 2:51=A0pm, News123 <news...@free.fr> wrote:
> Chad wrote:
> > On Jan 2, 1:52 pm, Tim Greer <t...@burlyhost.com> wrote:
> >> Chad wrote:
> >>> Hi there,
> >>> I am a Perl novice and am looking for a simple script to access a web
> >>> page, enter some data, and examine the response.
> >>> Does anyone have anything like this?
>
> Hi,
>
> This can be anything from quite trivial to quite annoying, depending on
> the web server and the amount of Cookies, Javascript, Flash Plugins,
> Java Applets being sued by your page.
>
> You should probably look at following modules
> - LWP::UserAgent # to access the page, enter the data and post/get it
> - WWW::Mechanize # sub class of LWP::UserAgent, probably simpler,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# but I never used ut
>
> - HTML::Parser # to examine the response. If the response is very simple
> you could also just use a regular expression.
>
> - HTTP::Cookies # Only needed if browsing the page doesn't work without
> cookies
>
> Please note, that these modules are not necessarily installed on your PC,
>
> To find out whether a module exists, you coulcd check,
> You can try to executa an empty perl script, which uses this module:
> =A0perl -MLWP::UserAgent -e ''
>
> or you try to read the module's documentation:
> perldoc LWP::UserAgent # if there's no doc the module doesn't exist
>
> Installing these modules depends on your OS / perl distribution
>
> For examples you can look at:
>
> http://search.cpan.org/~gaas/libwww-perl-5.822/lib/LWP/UserAgent.pmhttp:/=
/search.cpan.org/~petdance/WWW-Mechanize-1.52/lib/WWW/Mechanize.pm
>
> bye
>
> N
>
>
>
> > . .
> >> There are a lot of scripts that accept data entered and then respond
> >> accordingly. =A0I'd wager that a high majority of scripts for the web =
are
> >> designed for that specific task. =A0What exactly are you looking to
> >> do/have passed to it and process (and display a result, I assume)?
> >> There are likely existing scripts to do exactly what you want.
> >> --
> >> Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
> >> Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
> >> and Custom Hosting. =A024/7 support, 30 day guarantee, secure servers.
> >> Industry's most experienced staff! -- Web Hosting With Muscle!
>
> > Hi there,
> > Wow, thanks for the quick response. I have a large list of objects
> > that I want to enter on a web page to see if they exist. So the basic
> > flow would be read file, send object name to the web page, hit search,
> > return the result.- Hide quoted text -
>
> - Show quoted text -
Thanks again. I have been trying that but the documentation isn't the
best. I am looking for a little better working example to play with.
------------------------------
Date: Fri, 02 Jan 2009 22:19:06 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Script to insert data to a web page?
Message-Id: <6s7emeF4jjnlU1@mid.individual.net>
Chad wrote:
> Hi there,
> I am a Perl novice
http://learn.perl.org/
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Fri, 2 Jan 2009 16:38:25 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Script to insert data to a web page?
Message-Id: <slrnglt5r1.t2u.tadmc@tadmc30.sbcglobal.net>
Chad <cjohnso9@amfam.com> wrote:
> I am a Perl novice and am looking for a simple script to access a web
^^^^^^^^^^^
If you are instead "looking to write" such a script, then this
is the right place to ask.
> page, enter some data, and examine the response.
use WWW::Mechanize
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Fri, 02 Jan 2009 23:51:31 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: Script to insert data to a web page?
Message-Id: <1230940291.13758.0@proxy02.news.clara.net>
Chad wrote:
> Hi there,
> I am a Perl novice and am looking for a simple script to access a web
> page, enter some data, and examine the response.
>
> Does anyone have anything like this?
>
I've got just the resource for you: http://tinyurl.com/a28wgc
--
Henry Law Manchester, England
------------------------------
Date: Sat, 03 Jan 2009 03:01:21 +0100
From: News123 <news123@free.fr>
Subject: Re: Script to insert data to a web page?
Message-Id: <495ec6f1$0$28134$426a74cc@news.free.fr>
Chad wrote:
> On Jan 2, 2:51 pm, News123 <news...@free.fr> wrote:
>> Chad wrote:
>>> On Jan 2, 1:52 pm, Tim Greer <t...@burlyhost.com> wrote:
>>>> Chad wrote:
>>>>> Hi there,
>>>>> I am a Perl novice and am looking for a simple script to access a web
>>>>> page, enter some data, and examine the response.
>>>>> Does anyone have anything like this?
>> Hi,
>>
>> This can be anything from quite trivial to quite annoying, depending on
>> the web server and the amount of Cookies, Javascript, Flash Plugins,
>> Java Applets being sued by your page.
>>
>> You should probably look at following modules
>> - LWP::UserAgent # to access the page, enter the data and post/get it
>> - WWW::Mechanize # sub class of LWP::UserAgent, probably simpler,
>> # but I never used ut
>>
. . .
>
> Thanks again. I have been trying that but the documentation isn't the
> best. I am looking for a little better working example to play with.
As mentioned before web pages can be very different.
This means in other words, that nobody can really help you if you don't
give us more information.
Where do you fail exactly?
- Fetching the url?
- sending the post / get request with the valeus you filled in?
- analyzing the result ?
It might be useful if you show what you have already written (or tried
to write) so far and if you gave a concrete example.
( url to fetch, values to fill in, etc.)
bye
N
------------------------------
Date: Fri, 2 Jan 2009 17:28:58 -0800 (PST)
From: "freesoft12@gmail.com" <freesoft12@gmail.com>
Subject: Re: Unit test that checks for "croak"
Message-Id: <28a9e50f-ccbf-488a-ba49-b655257a824e@r15g2000prd.googlegroups.com>
> eval { deleteDoubleDotsInPath(\$path) } ;
>
> ok( !$@, 'delete double dots' ) ;
>
> uri
Hi,
Here is what I have done to solve the problem:
1) I added a special message in the 'croak' call:
sub deleteDoubleDotsInPath {
my $text = shift;
croak "Bad argument" if !check_path_($path_ref); # check validity of
argument
...
}
2) In the Test, I search for the message in the negative test:
# failure tests
$path = '../c'; # passing in a bad path
eval { deleteDoubleDotsInPath(\$path);};
ok($@ =~ m/Bad argument/,"Test Four"); # check if the message is what
we expect
Regards
John
------------------------------
Date: Fri, 02 Jan 2009 14:47:35 -0800
From: Don Geddis <don@geddis.org>
Subject: Re: Why not Ruby?
Message-Id: <878wpt8gvs.fsf@geddis.org>
Richard Riley <rileyrgdev@gmail.com> wrote on Thu, 01 Jan 2009:
> Tim Greer <tim@burlyhost.com> writes:
>> That poster has a frequent habit of cross posting to multiple, irrelevant
>> news groups. There's no rhyme or reason to it.
>
> No rhyme nor reason? It's quite clear, to me, why. How is a comparison
> article not relevant when he is trying to stimulate discussion about
> alternative languages for modern development?
Sometimes crossposting can be useful. But you ought to at least be aware
of some of the possible drawbacks, e.g. expressed here:
http://www.nhplace.com/kent/PFAQ/cross-posting.html
In particular, the usual hope by the poster is that the content is relevant
to the union of people in the different groups, but the actual experience is
that it is often relevant only to the intersection of such people.
And, moreover, that a long cross-posted thread on controversial topics often
winds up with people talking at cross-purposes past each other, because they
don't share enough common values to have a useful conversation.
In particular, the poster that started this thread is well known for adding
far more noise than signal to any discussion, and for showing no interest in
the greater good of any of the communities, but only in his own
glorification.
You labor under the delusion that there is at least good intent here, and the
poster ought to receive the benefit of the doubt. Long prior experience shows
that this hope is misplaced.
-- Don
_______________________________________________________________________________
Don Geddis http://don.geddis.org/ don@geddis.org
The only purpose for which power can be rightfully exercised over any member of
a civilized community, against his will, is to prevent harm to others. His own
good, either physical or moral, is not a sufficient warrant.
-- John Stuart Mill, _On Liberty_
------------------------------
Date: Fri, 02 Jan 2009 16:20:49 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Why not Ruby?
Message-Id: <Bby7l.24782$4u2.10452@newsfe02.iad>
Don Geddis wrote:
> Richard Riley <rileyrgdev@gmail.com> wrote on Thu, 01 Jan 2009:
>> Tim Greer <tim@burlyhost.com> writes:
>>> That poster has a frequent habit of cross posting to multiple,
>>> irrelevant
>>> news groups. There's no rhyme or reason to it.
>>
>> No rhyme nor reason? It's quite clear, to me, why. How is a
>> comparison article not relevant when he is trying to stimulate
>> discussion about alternative languages for modern development?
>
> Sometimes crossposting can be useful. But you ought to at least be
> aware of some of the possible drawbacks, e.g. expressed here:
> http://www.nhplace.com/kent/PFAQ/cross-posting.html
>
> In particular, the usual hope by the poster is that the content is
> relevant to the union of people in the different groups, but the
> actual experience is that it is often relevant only to the
> intersection of such people.
>
> And, moreover, that a long cross-posted thread on controversial topics
> often winds up with people talking at cross-purposes past each other,
> because they don't share enough common values to have a useful
> conversation.
>
> In particular, the poster that started this thread is well known for
> adding far more noise than signal to any discussion, and for showing
> no interest in the greater good of any of the communities, but only in
> his own glorification.
>
> You labor under the delusion that there is at least good intent here,
> and the
> poster ought to receive the benefit of the doubt. Long prior
> experience shows that this hope is misplaced.
>
> -- Don
Thank you, Don, for outlining the issue far more eloquently than I was
able to. Also, to be clear, I don't think anyone's upset that people
find his posts interesting, but it doesn't make it so for everyone else
(or assign them any ailment if they don't see it that way) --
especially in regard to the other groups he cross posts to (of which
one should have specifically been the ruby group, but I digress.)
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
------------------------------
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 2096
***************************************