[30397] in Perl-Users-Digest
Perl-Users Digest, Issue: 1640 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 13 21:09:48 2008
Date: Fri, 13 Jun 2008 18:09:10 -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 Fri, 13 Jun 2008 Volume: 11 Number: 1640
Today's topics:
Re: calling external program tiff2pdf <1usa@llenroc.ude.invalid>
Re: converting Java code to Perl (using LWP?) <ben@morrow.me.uk>
Re: converting Java code to Perl (using LWP?) PugetSoundSylvia@gmail.com
Re: converting Java code to Perl (using LWP?) <ben@morrow.me.uk>
Re: Has anyone compiled HPUX::pstat under hpux 11.11 us <ben@morrow.me.uk>
Re: How to close all started Internet Explorer from per dummy@phony.info
Re: How to close all started Internet Explorer from per <jurgenex@hotmail.com>
Re: How to close all started Internet Explorer from per dummy@phony.info
Re: Learning Perl <elizabethbarnwell@gmail.com>
Re: Learning Perl <dragnet\_@_/internalysis.com>
Re: Learning Perl <uri@stemsystems.com>
Re: Learning Perl <benkasminbullock@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 13 Jun 2008 22:11:21 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: calling external program tiff2pdf
Message-Id: <Xns9ABCB90643395asu1cornelledu@127.0.0.1>
"John" <john1949@yahoo.com> wrote in
news:g2tvd1$epa$1@news.albasani.net:
> Manage to crack it. You need to place all parameters in quotes
> including the -o.
>
> system ("tiff2pdf","-o","$newfile","$filename")
Nope, you misunderstand what you did here. The quotation marks above are
not important. What is important is the fact that you passed system a LIST
rather than a single string which by-passed the shell. I am assuming the
actual $newfile and $filename contained some characters that were
problematic for the shell.
perldoc -f system
Read the documentation for the functions you use.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Fri, 13 Jun 2008 21:16:10 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: converting Java code to Perl (using LWP?)
Message-Id: <a51bi5-n3i.ln1@osiris.mauzo.dyndns.org>
Quoth PugetSoundSylvia@gmail.com:
> Hello all,
>
> I've been banging my head against the wall trying to get some code
> working in Perl. I'm assuming it will need to use the LWP module, and
> I've gotten some basic things working with LWP, but not the whole
> thing.
>
> I have samples in Java, shown below. I'm stuck at the
> setRequestProperty. What's the equivalent in Perl, using LWP?
Since you haven't posted any Perl, it's rather hard to know where you're
going wrong. You can set request headers with HTTP::Request->header; you
can specify credentials to be used with HTTP auth on every request with
LWP::UserAgent->credentials.
Ben
--
Razors pain you / Rivers are damp
Acids stain you / And drugs cause cramp. [Dorothy Parker]
Guns aren't lawful / Nooses give
Gas smells awful / You might as well live. ben@morrow.me.uk
------------------------------
Date: Fri, 13 Jun 2008 14:20:25 -0700 (PDT)
From: PugetSoundSylvia@gmail.com
Subject: Re: converting Java code to Perl (using LWP?)
Message-Id: <99088f5b-2f43-40f3-b2bf-bd22e2a3bb1d@v26g2000prm.googlegroups.com>
Thanks for your response, Ben. I've posted what I have so far below
(it doesn't work, returns 'Error: 401 Unauthorized').
Also, here's what my limited documentation says:
In order to be allowed through the firewall, users must send an
authentication HTTP header
along with every request.
The header structure is: Authorization: BASIC xxxxxxxxxxxxxxxx=85
where xxxxxxx is a firewall user name and password separated by
=93:=94 and converted into BASE64-
encoded format.
***************************************
***************************************
use MIME::Base64;
use LWP::UserAgent;
$ua =3D LWP::UserAgent->new;
$req =3D HTTP::Request->new(GET =3D> 'http://SiteName.org/login.php?
name=3DAppName&pass=3DAppPWD&service_type=3Dxxx');
$Encoded =3D encode_base64('FireWallName:FireWallPWD',''); #Encode
into Base64
$FullAuthorization =3D 'Basic ' . $Encoded; # not sure if Basic is
upper or lower - documentation is contradictory
$req->header('Authorization' =3D> $FullAuthorization);
# send request
$res =3D $ua->request($req);
# check the outcome
if ($res->is_success) {
print $res->decoded_content;
}
else {
print "Error: " . $res->status_line . "\n";
}
------------------------------
Date: Sat, 14 Jun 2008 00:33:32 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: converting Java code to Perl (using LWP?)
Message-Id: <cncbi5-m4o.ln1@osiris.mauzo.dyndns.org>
Quoth PugetSoundSylvia@gmail.com:
> Thanks for your response, Ben. I've posted what I have so far below
> (it doesn't work, returns 'Error: 401 Unauthorized').
>
> Also, here's what my limited documentation says:
>
> In order to be allowed through the firewall, users must send an
> authentication HTTP header
> along with every request.
> The header structure is: Authorization: BASIC xxxxxxxxxxxxxxxx…
> where xxxxxxx is a firewall user name and password separated by
> “:” and converted into BASE64-
> encoded format.
>
> ***************************************
> ***************************************
>
> use MIME::Base64;
> use LWP::UserAgent;
>
> $ua = LWP::UserAgent->new;
>
> $req = HTTP::Request->new(GET => 'http://SiteName.org/login.php?
> name=AppName&pass=AppPWD&service_type=xxx');
> $Encoded = encode_base64('FireWallName:FireWallPWD',''); #Encode
> into Base64
> $FullAuthorization = 'Basic ' . $Encoded; # not sure if Basic is
> upper or lower - documentation is contradictory
It's case-insensitive, so either ought to work.
> $req->header('Authorization' => $FullAuthorization);
>
> # send request
> $res = $ua->request($req);
>
> # check the outcome
> if ($res->is_success) {
> print $res->decoded_content;
> }
> else {
> print "Error: " . $res->status_line . "\n";
> }
That ought to work, I'd say. It would be easier to simply call
$ua->credentials, passing the appropriate information, and let LWP
handle constructing the header for you; finding out what the correct
'netloc' and 'realm' are will mean printing out the contents of the 401
response.
If this doesn't work, add
use LWP::Debug qw/+conns/;
to the top of your script, and post the output.
Ben
--
Many users now operate their own computers day in and day out on various
applications without ever writing a program. Indeed, many of these users
cannot write new programs for their machines...
-- F.P. Brooks, 'No Silver Bullet', 1987 [ben@morrow.me.uk]
------------------------------
Date: Fri, 13 Jun 2008 21:13:01 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Has anyone compiled HPUX::pstat under hpux 11.11 using aCC
Message-Id: <dv0bi5-n3i.ln1@osiris.mauzo.dyndns.org>
Quoth "Dan Mercer" <damercer@comcast.net>:
> "Ben Morrow" <ben@morrow.me.uk> wrote in message
> news:5brai5-1de.ln1@osiris.mauzo.dyndns.org...
> > [f'ups set to clpm]
> >
> > Quoth "Dan Mercer" <damercer@comcast.net>:
> >> when I do the "perl Makefile.PL" I get a makefile for gcc which doesn't
> >> build:
> >>
> >> cc1: error: unrecognized option '-Wdeclaration-after-statement'
> >>
> >> going into the Makefile to change gcc to aCC just creates more errors.
> >
> > You have to build perl modules with the same compiler used to build your
> > perl.
> >
> >> $ gcc --version
> >> gcc (GCC) 3.3.2
> >
> > If you have gcc why are you trying to build with aCC?
>
> Because gcc didn't work. It's likely our perl was not built locally
> and was either gotten through HP or the HP-UX Porting Archive, so
> compiling with the same exact version of the compiler would not be
> possible. Indeed, a check of perl -V indicates gccversion 4.2.0, so it
> was almost certainly from the Porting Archive. So, do I need to get
> 4.2.0? And will it work even then?
If at all possible, I would recommend building perl from source yourself
with the compiler you intend to use. Alternatively, you may be able to
find a build you can use on
http://mirrors.develooper.com/hpux/downloads.html . In either case, you
should not relocate perl after building it.
If you can't do this, for some reason, you can try installing the
correct compiler (4.2.0) and building the extension with that. I suspect
it still won't work as Config.pm will still think perl is installed in
/usr/local; you *may* be able to fix this by going over Config.pm and
Config_heavy.pl and changing all the paths. Making the corresponding
changes from gcc syntax to aCC syntax is even less likely to work,
especially as perl will be linked with libgcc so aCC may end up calling
different versions of C library functions.
> Are you truly a Buffy fan?
Heh. Yes. :)
Ben
--
I touch the fire and it freezes me, [ben@morrow.me.uk]
I look into it and it's black.
Why can't I feel? My skin should crack and peel---
I want the fire back... BtVS, 'Once More With Feeling'
------------------------------
Date: Fri, 13 Jun 2008 14:25:01 -0700
From: dummy@phony.info
Subject: Re: How to close all started Internet Explorer from perl scripts?
Message-Id: <i6p554to3chc3mrmg0h19igppgvuc18n7m@4ax.com>
On Thu, 12 Jun 2008 01:38:45 GMT, Jürgen Exner <jurgenex@hotmail.com>
wrote:
>"Pero" <pero@tupwerwt.ch> wrote:
>>How to close all started Internet Explorer from perl scripts?
>
>I am sure there is a more Windowish way but one way to do it:
>
>Install the SFU kit (free from the MS website).
>Then run
> system ('kill iexplore');
>from your Perl program. That shall do it.
>
>jue
I tried, unsuccessfully, to find the download site for SFU. Went around
and around various 'white papers' and such, but no place offering a
download. Perhaps you can give a link?
------------------------------
Date: Fri, 13 Jun 2008 21:33:29 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How to close all started Internet Explorer from perl scripts?
Message-Id: <hpp554taru6ikp402odav8rb837e13ikij@4ax.com>
dummy@phony.info wrote:
>On Thu, 12 Jun 2008 01:38:45 GMT, Jürgen Exner <jurgenex@hotmail.com>
>>Install the SFU kit (free from the MS website).
>>
>I tried, unsuccessfully, to find the download site for SFU. Went around
>and around various 'white papers' and such, but no place offering a
>download. Perhaps you can give a link?
http://www.microsoft.com/downloads/details.aspx?FamilyID=896c9688-601b-44f1-81a4-02878ff11778&DisplayLang=en
Popped up as the second link when searching for SFU in the Download
category.
jue
------------------------------
Date: Fri, 13 Jun 2008 17:27:09 -0700
From: dummy@phony.info
Subject: Re: How to close all started Internet Explorer from perl scripts?
Message-Id: <8v3654t3aesf10tlgm8nob3hs4qj6sor2e@4ax.com>
On Fri, 13 Jun 2008 21:33:29 GMT, Jürgen Exner <jurgenex@hotmail.com>
wrote:
>dummy@phony.info wrote:
>>On Thu, 12 Jun 2008 01:38:45 GMT, Jürgen Exner <jurgenex@hotmail.com>
>>>Install the SFU kit (free from the MS website).
>>>
>>I tried, unsuccessfully, to find the download site for SFU. Went around
>>and around various 'white papers' and such, but no place offering a
>>download. Perhaps you can give a link?
>
>http://www.microsoft.com/downloads/details.aspx?FamilyID=896c9688-601b-44f1-81a4-02878ff11778&DisplayLang=en
>
>Popped up as the second link when searching for SFU in the Download
>category.
>
>jue
I googled 'site: microsoft.com sfu download' no luck.
------------------------------
Date: Fri, 13 Jun 2008 13:18:54 -0700 (PDT)
From: Elizabeth Barnwell <elizabethbarnwell@gmail.com>
Subject: Re: Learning Perl
Message-Id: <1174bcbf-242a-4c05-92ca-5a119b5932f1@z66g2000hsc.googlegroups.com>
On Jun 13, 8:44 am, mer...@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "Jim" == Jim Cochrane <allergic-to-s...@no-spam-allowed.org> writes:
>
> Jim> IOW, in Perl, a semicolon is a statement separator, not a statement
> Jim> terminator.
>
> No, you're recalling Pascal.
>
> In Perl, it is indeed a statement terminator, but only for those statements
> that require it (not a while or an if, for example). However, the final
> semicolon of any scope (file or block or eval-string) is optional.
>
> print "Just another Perl hacker,"; # the original
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> Seehttp://methodsandmessages.vox.com/for Smalltalk and Seaside discussion
Hi Everyone,
Thank you for your candid feedback. I do appreciate it. Like I said,
this is the first step for us- We are adding features to the site to
allow users to comment on/make corrections to existing content/build
learning material together/attribute content to various sources.
Regarding usefulness- our developers, and many others have found it
very effective. But it may not be your style. I will update you when
we've added to community piece so we can put your rants/raves to good
use.
Thanks again,
Elizabeth
------------------------------
Date: Fri, 13 Jun 2008 15:51:09 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Learning Perl
Message-Id: <Xns9ABCAB6531F1Ddragnetinternalysisc@216.196.97.131>
Elizabeth Barnwell <elizabethbarnwell@gmail.com> fell face-first on the
keyboard. This was the result:
news:1174bcbf-242a-4c05-92ca-5a119b5932f1@z66g2000hsc.googlegroups.com:
> On Jun 13, 8:44 am, mer...@stonehenge.com (Randal L. Schwartz) wrote:
>> >>>>> "Jim" == Jim Cochrane <allergic-to-s...@no-spam-allowed.org>
>> >>>>> writes:
>>
>> Jim> IOW, in Perl, a semicolon is a statement separator, not a
>> statement Jim> terminator.
>>
>> No, you're recalling Pascal.
>>
>> In Perl, it is indeed a statement terminator, but only for those
>> statements that require it (not a while or an if, for example).
>> However, the final semicolon of any scope (file or block or
>> eval-string) is optional.
>>
>> print "Just another Perl hacker,"; # the original
>>
>> --
>> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
>> 777 0095 <mer...@stonehenge.com>
>> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix
>> consulting, Technical writing, Comedy, etc. etc.
>> Seehttp://methodsandmessages.vox.com/for Smalltalk and Seaside
>> discussion
>
> Hi Everyone,
>
> Thank you for your candid feedback. I do appreciate it. Like I said,
> this is the first step for us- We are adding features to the site to
> allow users to comment on/make corrections to existing content/build
> learning material together/attribute content to various sources.
>
> Regarding usefulness- our developers, and many others have found it
> very effective. But it may not be your style. I will update you when
> we've added to community piece so we can put your rants/raves to good
> use.
Elizabeth;
It's not a matter of "style" but of actual syntactical correctness. As has
been pointed out by others, some of your information is actually wrong - as
in, if you students use it, perl will cough up an error and exit.
Some of your terms are wrong, as has also been pointed out: When your users
come looking for help, using (incorrect) terms you've given them, they'll
either not find what they're looking for, or be laughed out of the
discussion. Worse for you, is when someone says "Who the hell told you that
nonsense?" and they point back to your school/site... I'm sure you can see
the potential for negative business growth there.
You *really* should hire a professional to look over your material - It
will save your students a lot of time and effort in the future and save
your business quite a bit of ambarassment.
Good luck.
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: Sat, 14 Jun 2008 00:31:52 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x73angzwjw.fsf@mail.sysarch.com>
>>>>> "EB" == Elizabeth Barnwell <elizabethbarnwell@gmail.com> writes:
EB> Regarding usefulness- our developers, and many others have found it
EB> very effective. But it may not be your style. I will update you when
EB> we've added to community piece so we can put your rants/raves to good
EB> use.
but who judges how well the newbies are learning from this? they can't
judge themselves. this is a classic problem of peer review or the lack
thereof. i have seen many self-declared perl gurus who learned in a
vacuum or from bad sources. and they don't really know perl nor
programming. but they think they do. usually they don't take criticism
well either.
i come down hard on these weak web tutorials because there is good perl
stuff out there (learn.perl.org has a full free book online) and a large
and active perl community ready to provide peer review. did anyone in
your group ask for outside reviewers before it was published? how can
you tell how accurate it is without multiple eyes? even damian conway
with his last book (the excellent perl best practice) had about 20+ tech
reviewers who made the final book so much better.
so consider my comments an outside review. but beyond that, i seriously
doubt you can learn to program at any decent level with just simple
flash cards. there is too much knowledge missing from them and it is so
easy to link to it.
i will not recommend this site to anyone for that main reason.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Sat, 14 Jun 2008 00:36:35 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Learning Perl
Message-Id: <g2v3qj$rsg$1@ml.accsnet.ne.jp>
On Fri, 13 Jun 2008 12:51:58 +0000, Uri Guttman wrote:
> BB> The other problem is that the people who do know enough Perl seem
to
> BB> prefer writing incomprehensible gibberish ("Camel Books",
"perldoc
> BB> perlre", etc.) to writing something that normal people can
understand.
>
> and how much technical writing or editing have you done?
About Perl, none, although I've done enough reading of Perl stuff to know
how badly edited and badly written many of them are. A couple of years or
more ago, I tried and failed to learn about Perl's references by reading
the 3rd edition of the "Camel Book" and "perlreftut". I then went off and
worked it out myself, basically by writing enough code, and by getting
answers on this newsgroup from people like Tad McClellan and Peter
Holzer, and looking at examples, and so on. Then, a few months ago, when
I'd figured it out, I went back and read the "Camel Book" again, and
found that I still couldn't make sense of it, even though I actually
understood the use of Perl's references fairly well at that point.
> >> there could be links to the docs, more info in each answer,
> >> better grouping of questions, etc.
>
> BB> Then they'd be completely inaccessible to beginners.
>
> nope. you can do that very easily. links to the online docs at
> perldoc.perl.org are trivial to make.
I'm talking about whether it's readable or not, not the technical
difficulty of doing it.
> >> Syntax for looping through the values in a list
> >> foreach $var @array {
> >> }
> >>
> >> that should be my $var.
>
> BB> Why, though? Who's to say that $var isn't declared previously?
>
> and then that would be a likely bug. foreach localizes its loop variable
> which would mask the my var. please learn perl before you critique a
> critique of a tutorial
>
> perl -le 'my $x = 1 ; for $x ( 1 .. 3 ) {print $x} print $x'
> 1
> 2
> 3
> 1
If that's your point it's a good one, but that wasn't what you said above.
> >> Operators to add and remove items from the beginning of array
> >> unshift(@array, new_item)
> >> shift(@array)
> >>
> >> what is new_item? unless that is a predeclared sub with a
prototype it
> >> is illegal. and it doesn't mention unshift takes a list.
>
> BB> Oh, yes, that's right, people who are starting to learn something
> BB> don't usually learn all the details at first.
>
> but correct syntax is needed. or an explanation of what 'new_item' is.
Why is correct syntax needed? Seriously - a lot of computer books use
pseudo-code and italics to indicate something is not correct.
> >> nor does it say
> >> which function adds or removes (sure they are in the order
mentioned in
> >> the question but it should be pointed out. the same is true for the
> >> push/pop slide.
>
> BB> Yes, if you don't add more and more details to the explanation, it
> BB> won't be confusing enough for a complete beginner, then they won't
> BB> feel frustrated, give up, and go and learn Python instead.
>
> nope. they would be pissed at the teacher.
I'll take back the above comment - re-reading it I agree with what you
said above.
> >> the slides always say operator for what most call functions. sure
they
> >> are operators in some sense (they don't always need parens) but it
is
> >> poor terminology to always say operator.
>
> BB> Again, unless it's vitally important, tortured details like this
don't
> BB> really belong in explanations for beginners. People can learn the
details
> BB> once they've grasped the concepts more clearly.
>
> nope. correct terminology makes it easier to understand and causes fewer
> problems later on.
I'll take your word for it here, I'm not sure about this issue.
> and you don't get teaching perl or programming languages. sure you start
> simple but the concept of alternate delims is a simple one.
Is it? You're correct that I've never taught anybody Perl, but if I did
I'd expect people to get confused if I just started babbling about
alternate delimiters.
> flash cards are a classic method to learn rote material. they rarely
> require the need to think. as such they are used for tests covering
> finite subject matter. perl is not a finite nor is even a small subset
> that easy to rote learn.
No-one has suggested that people try to learn Perl solely by looking at
these cards, without writing any computer code. These cards are quiz
questions for people who are learning, presumably learning by writing
code.
> programming is more about concepts than
> details. again, you haven't done any training nor writing if you think
> rote learning is a gohttp://library.thinkquest.org/16728/content/cgi/
cplusplus.htmlod way to teach perl.
Who has suggested that rote learning is a good way to teach Perl? Nobody.
> >> What is the syntax for a list literal
> >> ( value1, value2, ....)
> >>
> >> huh? that is a list. literals are possible values in the list.
> >>
> >> What is the effect of using negative number for an array index
> >> it starts counting from the end of the array backwards
> >>
> >> that is from the department of redundant answers department.
>
> BB> Sorry, but I don't see why it is redundant. That seems like a
useful
> BB> piece of knowledge to me. C programmers who used a negative
number in an
> BB> array index would expect to get a crash and a "segmentation
fault" error,
> BB> so why is it redundant to point out that Perl is different from C
here?
>
> hmm, what other direction can you count from the end ot the array?
I disagree. If it actually said "it starts counting from the end of the
array" without the "backwards", that actually would be confusing for the
beginner. A lot of people would imagine that it is going forwards - which
is actually quite possible given that Perl doesn't declare array sizes.
> 50 questions and answers and 1 typo. maybe 3 pages of text. if i saw a
> book with such a ratio i would puke. i have tech edited 4 perl books and
> none had such a ratio of typos.
Nonsense. I've edited stuff written by native speakers of English which
had many more typos. About nine months ago I was working with a guy who
used to brag what a great writer of English he was, and yet he even made
mistakes in things like "it's" and "its". I recently read a John Grisham
novel which had a spelling mistake on nearly every page.
When we get into computer programming, in which it's not intuitively
obvious to most people when there is an error, I'm pretty sure that we
can expect many more small errors. Somewhere on the web there is a list
of errata for Donald Knuth's books "The Art of Computer Programming". You
might know Knuth as "the guy who takes an incredible amount of care over
his books", so much so that he even created a computer typesetting system
for them, and it might be instructive to have a gander at the list of
errors that slipped through into his books before one starts proclaiming
about how error-free most tech books are compared to these flashcards.
> poor writing and little editing is
> obvious here.
There are some problems with the cards - let's see whether they get fixed
or not.
> and when you declare my @array or %hash, what does it contain initially?
> arrays and hashes are variables too. and should be covered as much if
> not more than scalars
But the beginner starts off with $x = "Hallo World".
> BB> There are ways to phrase things so that they are easy to
understand and
> BB> also not incorrect.
>
> >> Comparison operator for numbers
> >> ==
> >>
> >> hmm, i wonder what >, <, >= and <= have to say about that?
> >> s/Comparison/Equality/
>
> BB> As far as I know, the comparison operator for numbers is <=>.
>
> so you think the q/a is wrong too!
Yes, certainly - the comparison operator is <=>, so if the question says
"what is the comparison operator?" I would say "<=>" and then I'd be
annoyed if it said "==" was the correct answer.
> >> How are all numbers stored interally by Perl
> >> double-precision floating-point values
> >>
> >> hmm, i wonder what IV's have to say about that?
>
> BB> The question is a bit weird, I don't know how numbers are stored
> BB> internally by Perl.
>
> then why is it being asked? and why would you think it is important or
> not? why did you comment?
To correctly answer the question of how Perl's numbers are stored would
involve a knowledge of Perl's internals which I wouldn't expect a
beginner to have - thus the question is a bit weird. I don't know how the
numbers are stored either - is it a C struct or a union or something
else? I don't know the answer & I wouldn't expect beginners to either.
> a few? this was 50 questions. i found 15+ mistakes or bad wording. that
> is an awfully high ratio.
It's good to work on improving the mistakes in this kind of tutorial, but
a lot of the corrections you suggest involve cramming more information
into the tutorial. If it's intended for complete beginners, I doubt that
is going to work.
> >> simple questions like these is not the
> >> way to learn programming in any language.
>
> BB> Hmm, I have no idea, but since there are millions of people out
there,
> BB> who knows, perhaps it is usefuhttp://library.thinkquest.org/16728/
content/cgi/cplusplus.htmll for someone. I don't think it's
harmful.
>
> you haven't seen enough bad perl tutorials.
I've seen plenty of nearly incomprehensible Perl tutorials. I'd rather
learn from a tutorial with errors than one I can't understand. To take an
example from C++, since I know C++ better than Perl, here is a totally
bogus tutorial on how to write a C++ CGI program:
http://library.thinkquest.org/16728/content/cgi/cplusplus.html
The code there doesn't even compile, and it contains a lot of stupid
errors. However, I could understand it, so despite the errors it was
enough for me to work out the basics of how to make a C++ CGI program,
and start writing them myself. I don't think tutorials with errors in
them are nearly as harmful as tutorials which one can't understand - what
is going to happen if a learner programmer makes a mistake? Smoke starts
coming out of the computer, or something? Rather I would suggest that you
put a few deliberate mistakes in your tutorials to keep people on their
toes, like "spot the deliberate mistake in this tutorial and win a pizza".
> google for them and then come back.
I'm not sure I want to.
> the harm of them is way beyond your knowledge. ever heard of
> matt's scripts and the damage they caused perl for years?
No, I haven't heard of them and the damage they caused Perl for years.
But I'm sure it's fascinating, with lots of smoke belching out of
computers, tapes whirling forwards and backwards, lights flashing on and
off, and an ever-increasingly high pitched voice screaming "Cannot
compute! Cannot compute!" before the whole of the Star Ship Enterprise is
whisked into a space-time vortex from which only Spock's Vulcan mind-meld
with the damaged electronic device can save the day.
So please tell me the story.
------------------------------
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 1640
***************************************