[31489] in Perl-Users-Digest
Perl-Users Digest, Issue: 2748 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 2 09:09:46 2010
Date: Sat, 2 Jan 2010 06:09:09 -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, 2 Jan 2010 Volume: 11 Number: 2748
Today's topics:
Re: #calls to main::BEGIN = 6 with -d:DProf <source@netcom.com>
Re: Does every perl statement has to end with ';'? <OJZGSRPBZVCX@spammotel.com>
Re: Errors during PersistentPerl Compilation <rvtol+usenet@xs4all.nl>
Re: FAQ 6.10 What is "/o" really for? <sysadmin@example.com>
Re: FAQ 6.10 What is "/o" really for? <tadmc@seesig.invalid>
Re: How to put '#!/usr/bin/env perl -w' at the beginnin <xhoster@gmail.com>
Re: How to put '#!/usr/bin/env perl -w' at the beginnin <xhoster@gmail.com>
Re: WWW::Scripter or Javascript and perl <nathanabu@gmail.com>
Xah's Edu Corner: Teach Ourself Programing In Ten Years <xahlee@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 01 Jan 2010 20:55:58 -0800
From: David Harmon <source@netcom.com>
Subject: Re: #calls to main::BEGIN = 6 with -d:DProf
Message-Id: <wbOdncyH06mNT6PWnZ2dnUVZ_hOdnZ2d@earthlink.com>
On Fri, 1 Jan 2010 00:41:04 -0800 (PST) in comp.lang.perl.misc,
"++imanshu" <himanshu.garg@gmail.com> wrote,
> Could you tell me why #Calls to main::BEGIN increases as I
>include more and more modules.
Could it be because use module translates to something resembling
BEGIN { require module; }
------------------------------
Date: Fri, 01 Jan 2010 15:13:36 +0100
From: "Jochen Lehmeier" <OJZGSRPBZVCX@spammotel.com>
Subject: Re: Does every perl statement has to end with ';'?
Message-Id: <op.u5uxsyf3mk9oye@frodo>
On Thu, 31 Dec 2009 21:16:27 +0100, Peng Yu <pengyu.ut@gmail.com> wrote:
> It says in the following webpage [...] and many other tutorials
Just a general comment not related to your question (which has been
answered):
For many languages, it's popular to refer to "tutorials" of differing
quality. This is because many languages do not really come with good
online or interactive documentation. Older languages came with paper books
instead, or only delivered reference manuals in electronic form.
With Perl, this is very different. All features are very well documented
and that documentation comes with Perl itself. On perldoc.perl.org you can
browse that documentation online; on Unix systems, you can use "man perl"
or "perldoc perl" to get the starting page of the documentation, with a
very good description of where to look to get all the answers you really
need (this is the same as http://perldoc.perl.org/perl.html ). There, you
will find the rest of the documentation sorted by topic, for things like
semicolons, it's the "perl syntax". If you click that link, and then use
your browsers search function to look for "semicolon", you immediately get
the relevant section: "Every simple statement must be terminated with a
semicolon, unless it is the final statement in a block, in which case the
semicolon is optional."
So, all in all, I'd rather stay clear from "webpages and other tutorials"
for questions related strictly to Perl itself, and look first and foremost
in the Perl documentation itself. It is extremely complete and a pleasure
to read.
HTH
------------------------------
Date: Fri, 01 Jan 2010 15:40:16 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Errors during PersistentPerl Compilation
Message-Id: <4b3e0951$0$22903$e4fe514c@news.xs4all.nl>
Ferry Bolhar wrote:
> I'm trying to install PersistentPerl 2.22 on a Fedora 10 system with Perl
> 5.10.0 installed. During the make, I get some errors from gcc:
>
> perperl_perl.c: In function 'find_scr':
> perperl_perl.c:258: error: expected expression before 'PersistentScript'
> perperl_perl.c: In function 'get_string':
> perperl_perl.c:449: error: expected expression before 'char'
> perperl_perl.c: In function 'cwd_new':
> perperl_perl.c:484: error: expected expression before 'PersistentCwd'
> perperl_perl.c: In function 'onerun':
> perperl_perl.c:808: warning: comparison between pointer and integer
> perperl_perl.c:809: warning: comparison between pointer and integer
> perperl_perl.c:810: warning: comparison between pointer and integer
> perperl_perl.c: In function 'perperl_perl_init':
> perperl_perl.c:918: warning: passing argument 2 of 'perl_parse' from
> incompatible pointer type
>
> Deos someone use PersistentPerl under an environment like this? Or - since
> the module seems to be very old (October 2003) - is there a newer module
> which provides persistent context (didn't found somewhat on CPAN)?
Hi Ferry,
What problem are you trying to fix?
Current hardware, and OS-functionality, can probably already do all that
you need.
If not, see also mod_perl, and FastCGI (FCGI) on CPAN.
--
Ruud
------------------------------
Date: Fri, 01 Jan 2010 13:38:19 -0800
From: Wanna-Be Sys Admin <sysadmin@example.com>
Subject: Re: FAQ 6.10 What is "/o" really for?
Message-Id: <fXt%m.3831$w21.2548@newsfe17.iad>
sln@netherlands.com wrote:
> I am the greatest regex artist on the planet !!!!!
>
> -sln
And now the self proclaimed greatest regex artist on the planet as been
killfiled.
PS: Don't get so excited because you've only discovered how to actually
use /x in the last 6 months.
PSS: I'd put you against Tad, Randal, Exner, Rudd, Morrow, Uri,
Charlton, Gibson, DeFaria, myself, and on and on and on, any day.
PSSS: Hell, I'd even put you up against that Xah Lee spammer.
PSSSS: Pardon, I thought I had _already_ KF'ed you.
--
Not really a wanna-be, but I don't know everything.
------------------------------
Date: Fri, 01 Jan 2010 17:28:25 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: FAQ 6.10 What is "/o" really for?
Message-Id: <slrnhjt12i.io1.tadmc@tadbox.sbcglobal.net>
Wanna-Be Sys Admin <sysadmin@example.com> wrote:
> sln@netherlands.com wrote:
>
>> I am the greatest regex artist on the planet !!!!!
>>
>> -sln
>
> And now the self proclaimed greatest regex artist on the planet as been
> killfiled.
I just thought the original post was exactly 3 months early...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Fri, 01 Jan 2010 12:37:00 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: How to put '#!/usr/bin/env perl -w' at the beginning of a perl script?
Message-Id: <4b3e7e9f$0$12778$ed362ca5@nr5-q3a.newsreader.com>
Peng Yu wrote:
> On Dec 29, 4:17 pm, mer...@stonehenge.com (Randal L. Schwartz) wrote:
>>
>> Also, /usr/bin/env perl is a hack. You should replace it with your
>> specific perl path.
>
> If I use my specific perl path, it will not be portable, right?
Portable to what? Some machines don't even *have* a /usr/bin/env, so
using that surely is not portable. And what if the machine to which you
are porting does have /usr/bin/env, but also already has perl scripts
using /usr/bin/env to run their non-standard-location perl, which is
different than the porting-from machine's non-standard perl? How do you
have two different non-standard perls both appearing first in the path?
If you want to improve portability, then come up with a standard perl
version to use, and a standard place to install it, and then stick with
your standard. Anything else is just playing whack-a-mole.
> After
> all, if it moves to a different machine, the path has to be fixed.
Too bad there isn't a language that makes it easy to change the first
line of a large set of files...
Xho
------------------------------
Date: Fri, 01 Jan 2010 12:41:20 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: How to put '#!/usr/bin/env perl -w' at the beginning of a perl script?
Message-Id: <4b3e7ea1$0$18283$ed362ca5@nr5-q3a.newsreader.com>
Ben Morrow wrote:
>
> (Not that I think this is a good solution. env(1) on the #! line is a
> security risk, since you don't know what's in the PATH; I've always
> found it a little disconcerting that python recommends
>
> #!/usr/bin/env python
>
> in the standard docs.)
I don't really see that this is all that much of a problem, at least not
in the general case. If you actually don't know what is in your path,
and you don't trust that your path has been set by a benevolent
sys-admin, then it seems like you are already screwed six ways from
Sunday, Perl or no Perl.
Xho
------------------------------
Date: Sat, 2 Jan 2010 05:23:14 -0800 (PST)
From: Nathan <nathanabu@gmail.com>
Subject: Re: WWW::Scripter or Javascript and perl
Message-Id: <77eb7323-c3f5-46d5-8eca-7d13bdc6e235@j24g2000yqa.googlegroups.com>
On Dec 31 2009, 12:17=A0am, Tad McClellan <ta...@seesig.invalid> wrote:
> Steve C <smallp...@juno.com> wrote:
> > Nathan wrote:
> >> I have a HTML, which has a button , which I suspect using JavaScript:
> >> "
> >> <p><input type=3D"submit" id=3D"submitButton" value=3D"Submit" /></p><=
/
> >> form><script language=3D"Javascript">runMeAndFinish();</script></body>=
</
> >> html>"
>
> >> I tried to submit this form (click the submit button) which
> >> WWW::Mechanize, but to no avail
> >> $form->click_button( value =3D> 'Submit');
> >> didnt work, any other way didnt work as well, seems that maybe its
> >> javascripted...
> >> so , any idea how to use WWW::Scripter or any other way to click it??
>
> > So why not look at what the JS does?
>
> Simply looking at the request that the JS builds ought to do it.
>
> Hooking up the Web Scraping Proxy (wsp.pl) or similar will reveal
> the request that is ultimately sent.
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
first of all thank,
secondly, I've downloaded wsp.pl, according to the README file:
Set proxy to host:5364
Set secure proxy to host:5364
So I fired up my Firefox browser, navigated to the proxy settings, but
I couldn't figure out what to fill in there to make it work
I tried: HTTP PROXY: localhost PORT: 5364
it didnt work
any idea?
thanks,
------------------------------
Date: Sat, 2 Jan 2010 01:14:12 -0800 (PST)
From: Xah Lee <xahlee@gmail.com>
Subject: Xah's Edu Corner: Teach Ourself Programing In Ten Years?
Message-Id: <1035ce5d-914e-42c0-8e9c-a349a6d55e55@v25g2000yqk.googlegroups.com>
On Dec 25 2009, 12:44 am, r...@rpw3.org (Rob Warnock) wrote:
> jos...@corporate-world.lisp.de <jos...@lisp.de> wrote:
>
> +---------------
> | p...@informatimago.com (Pascal J. Bourguignon) wrote:
> | > LOL Yeah right! Give gavino ten years of rest to let
> | > his unconscious mind work on it!
> |
> | Norvig's 'Teach Yourself Programming in Ten Years' (
> |http://norvig.com/21-days.html
> | ) gets a new meaning...
> +---------------
See:
=E2=80=A2 The Condition of Industrial Programers
http://xahlee.org/UnixResource_dir/writ/it_programers.html
plain text version follows.
------------------------------
The Condition of Industrial Programers
Xah Lee, 2006-05
Before i stepped into the computing industry, my first industrial
programing experience was at Wolfram Research Inc as a intern in 1995.
(Wolfram Research is famously known for their highly successful
flagship product Mathematica) I thought, that the programers at
Wolfram are the world's top mathematicians, gathered together to
research and decide and write a extremely advanced technology. But i
realized it is not so. Not at all. In fact, we might say it's just a
bunch of Ph Ds (or equivalent experience). The people there, are not
unlike average white-collar Joes. Each working individually. And,
fights and bouts of arguments between co-workers are not uncommon.
Sometimes downright ugly in emails. Almost nothing is as i naively
imagined, as if some world's top mathematicians are gathered together
there, daily to confer and solve the world's top problems as in some
top secret government agency depicted in movies.
Well, that was my introduction to the industry. The bulk of my
surprise is due to my naiveness and inexperience of the industry, of
any industry, as i was just a intern and this is my first experience
seeing how the real world works.
After Wolfram, after a couple of years i went into the web programing
industry in 1998, using unix, Perl, Apache, Java, database
technologies, in the center of world's software technology the Silicon
Valley. My evaluation of industrial programers and how software are
written is a precipitous fall from my observations at Wolfram. In the
so-called Info Tech industry, the vast majority of programers are
poorly qualified. I learned this from my colleagues, and in dealing
with programers from other companies, service providers, data centers,
sys admins, API gateways, and duties of field tutoring. I didn't think
i have very qualified expertise in what i do, but the reality i
realized is that most are far lesser than me, and that is the common
situation. That they have no understanding of basic mathematics such
as trigonometry or calculus. Most have no interest in math whatsoever,
and would be hard pressed for them to explain what is a =E2=80=9Calgorithm=
=E2=80=9D.
I have always thought, that programing X software of field Y usually
means that the programers are thoroughly fluent in languages,
protocols, tools of X, and also being a top expert in field of Y. But
to my great surprise, the fact is that that is almost never the case.
In fact, most of the time the programers simply just had to learn a
language, protocol, software tool, right at the moment as he is trying
to implement a software for a field he never had experience in. I
myself had to do jobs half of the time i've never done before.
Constantly I'm learning new languages, protocols, systems, tools,
APIs, other rising practices and technologies, reading semi-written or
delve into non-existent docs. It is the norm in the IT industry, that
most products are really produces of learning experiences. Extremely
hurried grasping of new technologies in competition with deadlines.
There is in fact little actual learning going on, as there are immense
pressure to simply =E2=80=9Cget it to (demonstrably) work=E2=80=9D and ship=
it.
Thinking back, in fact the Wolfram people are the most knowledgeable
and inquisitive people i've met as colleagues, by far.
What prompted me to write this essay is after reading the essay Teach
Yourself Programming in Ten Years by Peter Norvig, 2001, at
http://www.norvig.com/21-days.html. In which, the LISP dignitary Peter
Norvig derides the widely popular computing books in the name of
Teaching Yourself X In (Fast) Days. Although i agree with his
sentiment that a language or technology takes time to master and use
well, that these books form somewhat of a damaging fad and subtly
multiply ignorance, but he fails to address the main point, that is:
the cause of the popularity of such books, and how to remedy the
situation.
When you work in the industry, and are given a responsibility of
coding in some new language the company decided to use, or emerging
protocol (such as voice-chat protocols or cellphone internet), or your
engineering group adopted a new team coding/reviewing process, you are
not going to tell you boss =E2=80=9Cnah, i want to do a good job so i'll st=
udy
the issue a few months before i contribute=E2=80=9D. Chances are, you are
going to run out and buy a copy of =E2=80=9CXYZ in 7 days=E2=80=9D, and com=
plete the
job in a way satisfactorily to your company, as well feeling proud of
your abilities in acquiring new material.
To see this in a different context, suppose you need to pass a
important Math XYZ exam or review in your career or get a certificate,
but you don't remember your Math XYZ. You will likely, run out and get
a =E2=80=9CMath XYZ for Dummies=E2=80=9D. Chances are, the book will indeed=
help you,
and you will pass your exam or interview, and actually have learned
something about XYZ, but never looked at Math XYZ squarely again.
These books are the bedrock of the industry. It is not because people
are impatient, or that they wish to hurry, but rather, it is the
condition of the IT industry, in the same way modern society drives
people to live certain life styles. No amount of patience or
proselytization can right this, except that we change the industry's
practice of quickly churning out bug-ridden software products to beat
competitors. Companies do that due to market forces, and the market
forces is a result of how people and organizations actually choose to
purchase software. In my opinion, a solution to this is by installing
the concept of responsible licenses. Please see this essay Responsible
Software Licensing and spread the word.
Xah
=E2=88=91 http://xahlee.org/
=E2=98=84
------------------------------
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 2748
***************************************