[25516] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7760 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 9 11:10:38 2005

Date: Wed, 9 Feb 2005 08:10: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           Wed, 9 Feb 2005     Volume: 10 Number: 7760

Today's topics:
    Re: The Problem with Perl <1usa@llenroc.ude.invalid>
    Re: The Problem with Perl (replace z with h, spam protection)
    Re: The Problem with Perl <goedicke@brandeis.edu>
    Re: The Problem with Perl <scobloke2@infotop.co.uk>
    Re: The Problem with Perl <goedicke@brandeis.edu>
    Re: The Problem with Perl <do-not-use@invalid.net>
    Re: The Problem with Perl <cwilbur@mithril.chromatico.net>
        using perl to submit username/password and access subse (Sam S.)
    Re: using perl to submit username/password and access s <nospam@bigpond.com>
    Re: using perl to submit username/password and access s <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 09 Feb 2005 13:00:45 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: The Problem with Perl
Message-Id: <Xns95F8518DCE716asu1cornelledu@127.0.0.1>

William Goedicke <goedicke@brandeis.edu> wrote in 
news:m3d5vauipd.fsf@goedsole.com:

> As a preferatory note let me say that I've been writing perl for a
> decade or so now and, I love perl.  It allows me to concentrate my
> sporadic programming efforts on a single tool because of its breadth
> of functionality.

Good for you.

> The point of this message is that I'd like to open a discussion that
> identifies exactly what it is about Perl as a language that offends
> the literati of programming 

Oh, please no.

perldoc -q compare

Sinan


------------------------------

Date: Wed, 9 Feb 2005 14:05:23 +0100
From: "D. Marxsen" <detlef.marxsen@tdds-gmbz.de (replace z with h, spam protection)>
Subject: Re: The Problem with Perl
Message-Id: <cud1qs$agm$1@domitilla.aioe.org>

"William Goedicke" <goedicke@brandeis.edu> schrieb im Newsbeitrag
news:m3d5vauipd.fsf@goedsole.com...
 ...
> Do others have knowledge of such (and possibly other) criticisms and,
> what do you think we should do to avoid the associated pitfalls.

To me a programming project leader said, perl were "write only language".

I don't take that comment too serious, as ...

 ... he is a Python fan ...

 ... Perl allows a lot of shortcuts which make it almost unreadable - but you
can omit these and write wonderful speaking code.
Speaking of me, my code looks a bit like Pascal - I don't use these fancy
$_, $. etc. pp. but use the English module any time.
Then, Perl is as readable as many other languages.


Just my two cents ...

Detlef


PS:
This topic may offend those who expect pure programming talk in this NG ...
but it may also be interesting to learn new arguments for defending Perl
against criticisms.

--
D. Marxsen, TD&DS GmbH
detlef.marxsen@tdds-gmbz.de (replace z with h, spam protection)




------------------------------

Date: Wed, 09 Feb 2005 08:43:27 -0500
From: William Goedicke <goedicke@brandeis.edu>
Subject: Re: The Problem with Perl
Message-Id: <m3bratu9vk.fsf@goedsole.com>

Dear Sinan - 

>>>>> "Sinan" == A Sinan Unur <1usa@llenroc.ude.invalid> writes:

    Sinan> William Goedicke <goedicke@brandeis.edu> wrote in
    Sinan> news:m3d5vauipd.fsf@goedsole.com:

    >> what it is about Perl as a language that offends the literati
    >> of programming

    Sinan> Oh, please no.

    Sinan> perldoc -q compare

I was hoping for considerably more depth than the perldoc answer,
semantic theory sort of stuff.

     - Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
     Cell 617-510-7244    http://www.goedsole.com:8080      
============================================================

          Lest we forget:

Happy isn't something you are; it's something you do.

	- William Goedicke



------------------------------

Date: Wed, 9 Feb 2005 13:44:21 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: The Problem with Perl
Message-Id: <cud43i$7e4$1@sparta.btinternet.com>

William Goedicke wrote:
> Dear Y'all - 
> 
> As a preferatory note let me say that I've been writing perl for a
> decade or so now and, I love perl.  It allows me to concentrate my
> sporadic programming efforts on a single tool because of its breadth
> of functionality.
> 
> I've got some friends whose programming activity is not at all like
> the sporadic hacks that I engage in.  They're extremely expert
> programmers with advanced programming degrees from MIT who are
> developing things like tank simulations for the DoD in lisp and other
> more arcane languages.  With the one caveat that it may be OK for a
> piker like me who doesn't need to code anything major, they speak of
> perl with utter contempt.

Then I suspect they are unlikely to ever change their minds, no matter what.

> The point of this message is that I'd like to open a discussion that
> identifies exactly what it is about Perl as a language that offends
> the literati of programming 

False premise, if at least one person qualifies as literati of 
programming and is not offended by Perl. Could it be that your friends' 
views are not unanimous amongst the "literati?"

I may be wrong, but "literati" means well-read. Have your friends a good 
understanding of Wall's goals and design decisions for Perl? If asked, 
can they articulate the criteria Wall and others described for their 
design of Perl 5?

> and, respecting that there may be some
> valid points there, how we can code to avoid the problems these issues
> may lead to.
> 

I feel more relevant questions might be: Who? Should they?

> My best understanding of what they think the problem is that Perl is
> "context sensitive".  That is it behaves differently when data
> changes, if lists slip in where scalars were intended the results may
> be wildly different than expected.  This wouldn't be true in strongly
> typed languages like C or lisp.

I'm no C programmer but I though bad things (tm) could happen if you 
passed a scalar to a function expecting a pointer to an array?

I guess, since I am ignorant of it, that Lisp treats everything as 
lists, including zero and single-length lists. I wonder how Lisp behaves 
"if x slips in where y were intended" for all x and y. E.g. strings, 
integers; references, pointers; constants, functions.

> 
> Do others have knowledge of such (and possibly other) criticisms and,
> what do you think we should do to avoid the associated pitfalls.
> 

Little, therefore nothing.
:-)


------------------------------

Date: Wed, 09 Feb 2005 08:56:31 -0500
From: William Goedicke <goedicke@brandeis.edu>
Subject: Re: The Problem with Perl
Message-Id: <m37jlhu99s.fsf@goedsole.com>

Dear Detlef et al - 

>>>>> "Detlef" == D Marxsen <detlef.marxsen@tdds-gmbz.de> writes:

    Detlef> ... Perl allows a lot of shortcuts which make it almost
    Detlef> unreadable

Perl is indeed heavily idiomatic but, if that's only a concern from a
readibility standpoint then I don't see how any other languages would
be exempt from the same criticism: python's indentation, lisp's
parentheses, C's preprocessor constructions.  All are hindrances to
readibility for those who aren't familiar with the language.

One could argue that idioms are also problematic if they have
side-effects which aren't clearly expressed in the syntax.  Perl makes
particularly heavy use of this and there are innumerable examples of 
pieces of code which do more than you would reasonably expect and, which
wouldn't be recognized except by those who've (carefully) read the right
chapter in the right O'Reily book.  (Having said that I've certainly 
dismissed those who haven't as beneath interest on many occasions ;)

    Detlef> PS: This topic may offend those who expect pure
    Detlef> programming talk in this NG ...

Hopefully members of the group will respect discussions like this as
"programming talk".  It's not *all* about fixing bad hash reference
syntax.

     - Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
     Cell 617-510-7244    http://www.goedsole.com:8080      
============================================================

          Lest we forget:

"ff0000" (html for bright red) turns out to be as good 
an indicator of spam as any pornographic term.

		- Paul Graham


------------------------------

Date: 09 Feb 2005 15:47:00 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: The Problem with Perl
Message-Id: <yzdoeet3i57.fsf@invalid.net>


Ian Wilson <scobloke2@infotop.co.uk> writes:
> William Goedicke wrote:
> > My best understanding of what they think the problem is that Perl is
> > "context sensitive".  That is it behaves differently when data
> > changes, if lists slip in where scalars were intended the results may
> > be wildly different than expected.  This wouldn't be true in strongly
> > typed languages like C or lisp.
> 
> I'm no C programmer but I though bad things (tm) could happen if you
> passed a scalar to a function expecting a pointer to an array?

Yes. If you use correct prototypes when compiling, and ask for warnings,
the compiler will warn. At runtime, you will probably get a core dump.

> I guess, since I am ignorant of it, that Lisp treats everything as
> lists, including zero and single-length lists. I wonder how Lisp
> behaves "if x slips in where y were intended" for all x and
> y. E.g. strings, integers; references, pointers; constants, functions.

Not everything is a list in Lisp. There are at least atoms (symbols)
too, and usually numbers separate from atoms.
Variables have no opinion at all about the kind of value that will be
put into them, but a value has a definite type. What the built-in functions
do with the different kinds of values depend on how sensible it is to
return a value. Taking the length of a number usually gives an error.
Some Lisp compilers can generate better code if told that a certain variable
will only hold values of a certain type.


------------------------------

Date: Wed, 09 Feb 2005 15:49:21 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: The Problem with Perl
Message-Id: <876511zqbr.fsf@mithril.chromatico.net>

>>>>> "WG" == William Goedicke <goedicke@brandeis.edu> writes:

    WG> I've got some friends whose programming activity is not at all
    WG> like the sporadic hacks that I engage in.  They're extremely
    WG> expert programmers with advanced programming degrees from MIT
    WG> who are developing things like tank simulations for the DoD in
    WG> lisp and other more arcane languages.  With the one caveat
    WG> that it may be OK for a piker like me who doesn't need to code
    WG> anything major, they speak of perl with utter contempt.

Being an expert does not prevent people from holding poorly-informed
opinions.  In fact, being an expert seems to be conducive to holding
poorly-informed opinions, because an expert can spend a considerable
amount of time learning about a narrow field and have only the vaguest
impression of what's going on outside that field.

    WG> Do others have knowledge of such (and possibly other)
    WG> criticisms and, what do you think we should do to avoid the
    WG> associated pitfalls.

Stop worrying about what other people think.  If Perl works well for
what you need done, use it.  If it doesn't, use something else.

Charlton



-- 
cwilbur at chromatico dot net
cwilbur at mac dot com


------------------------------

Date: 9 Feb 2005 04:13:11 -0800
From: junk2junk@hotmail.com (Sam S.)
Subject: using perl to submit username/password and access subsequent pages
Message-Id: <16e55509.0502090413.643d3b2b@posting.google.com>

Semi-newbie here. I am trying to write a perl script that uses LWP to
access the web pages that follow the initial login at
https://www.shopqf.com/login.asp

Of course I have a valid username and password that work when I use IE
but I want to do this entirely within perl.

I have tried a few methods in perl, including using the do_POST
functions and trying to use cookies, but obviously I am not doing
something right.

It seems the login page uses some YY_checkform function that I don't
understand and would prefer to not get into. I'd like to stick with
doing this in perl only.

Again, the goal is to use perl to login to this web site, then dig
around some of the subsequent web pages.

Any ideas? Thanks a lot folks!

Sam S.


------------------------------

Date: Wed, 09 Feb 2005 22:15:53 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: using perl to submit username/password and access subsequent pages
Message-Id: <36ud7qF569f9cU1@individual.net>

Sam S. wrote:

> Semi-newbie here. I am trying to write a perl script that uses LWP to
> access the web pages that follow the initial login at
> https://www.shopqf.com/login.asp
> 
> Of course I have a valid username and password that work when I use IE
> but I want to do this entirely within perl.
> 
> I have tried a few methods in perl, including using the do_POST
> functions and trying to use cookies, but obviously I am not doing
> something right.
> 
> It seems the login page uses some YY_checkform function that I don't
> understand and would prefer to not get into. I'd like to stick with
> doing this in perl only.
> 
> Again, the goal is to use perl to login to this web site, then dig
> around some of the subsequent web pages.
> 
> Any ideas? Thanks a lot folks!
> 
> Sam S.

You can try
http://search.cpan.org/~petdance/WWW-Mechanize-1.08/lib/WWW/Mechanize.pm

gtoomey


------------------------------

Date: Wed, 9 Feb 2005 08:13:06 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: using perl to submit username/password and access subsequent pages
Message-Id: <slrnd0k6ji.3t3.tadmc@magna.augustmail.com>

Sam S. <junk2junk@hotmail.com> wrote:

> I am trying to write a perl script that uses LWP to
> access the web pages that follow the initial login at
> https://www.shopqf.com/login.asp


> I have tried a few methods in perl,


Where have been POSTing the request to?


> It seems the login page uses some YY_checkform function that I don't
> understand and would prefer to not get into.


It is JavaScript, we don't want to get into it either.


> Any ideas? Thanks a lot folks!


The easiest way would be to use the Web Scraping Proxy, or similar,
to find out what requests are going back and forth:

      http://www.research.att.com/~hpk/wsp/


The harder way would be to figure out what this does:

<form action="dologin.asp" method="post" name="form1" class="shopqf" onSubmit="YY_checkform('form1','theusername','#q','0','Username is required.','thepassword','#q','0','Password is required.');return document.MM_returnValue">

But what that does has nothing to do with Perl, so this is not an
appropriate place to be doing that.


Anyway, are you POSTing to "dologin.asp" like the form action says to?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

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 7760
***************************************


home help back first fref pref prev next nref lref last post