[19879] in Perl-Users-Digest
Perl-Users Digest, Issue: 2074 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 5 21:06:02 2001
Date: Mon, 5 Nov 2001 18:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1005012308-v10-i2074@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 5 Nov 2001 Volume: 10 Number: 2074
Today's topics:
Re: Best language for low IQ programmers? <binary@eton.powernet.co.uk>
Re: Best language for low IQ programmers? (Patrick Doyle)
Re: Best language for low IQ programmers? (Thaddeus L Olczyk)
Re: Best language for low IQ programmers? (Thaddeus L Olczyk)
Re: Best language for low IQ programmers? (Thaddeus L Olczyk)
Re: Best language for low IQ programmers? <SEE_MY_SIG@nospam.demon.co.uk>
Re: Best language for low IQ programmers? <stonge81@hotmail.com>
Re: Best language for low IQ programmers? (Adrian Hoe)
Re: Best language for low IQ programmers? (Logan Shaw)
Dynamically Assigning Scalars On The Fly <newsgroup_mike@ultrafusion.co.uk>
helo! (hugh1)
Re: Is \n\n safe for http? <goldbb2@earthlink.net>
Re: One for the Perl Wizards... (Tad McClellan)
Re: Please help beginner with using cookies! <msisto@chat.carleton.ca>
Re: Please help with simple script <goldbb2@earthlink.net>
regex help please <willis3140@yahoo.com>
Re: regex help please (Logan Shaw)
Re: Sending Content Type in email <tassilo.parseval@post.rwth-aachen.de>
Re: Sending Content Type in email (Logan Shaw)
Re: Sending Content Type in email <tassilo.parseval@post.rwth-aachen.de>
Simple XML Parser example (Anand Ramamurthy)
sorry ! (hugh1)
Re: Teaching Perl to Middle School Students <ritchie@fnal.gov>
Re: Teaching Perl to Middle School Students <ritchie@fnal.gov>
Re: Teaching Perl to Middle School Students <joe+usenet@sunstarsys.com>
Re: Wrapping long emails - sample code <goldbb2@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 05 Nov 2001 23:09:21 +0000
From: Richard Heathfield <binary@eton.powernet.co.uk>
Subject: Re: Best language for low IQ programmers?
Message-Id: <3BE71C21.24BCC461@eton.powernet.co.uk>
Brian Metc wrote:
>
<snip>
>
> Would any one sugest the best language for me.
APL.
--
Richard Heathfield : binary@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
------------------------------
Date: Mon, 5 Nov 2001 23:37:03 GMT
From: doylep@eecg.toronto.edu (Patrick Doyle)
Subject: Re: Best language for low IQ programmers?
Message-Id: <GMCpLs.2Hw@ecf.utoronto.ca>
In article <1004990076967295@aol.com>, Brian Metc <BrianMetc@aol.com> wrote:
>
>Anyways, I want to go into computor programing because of money
>issue. I now need to choose languege for programming, simple enough
>for me.
You may want to begin with the TROLL programming language:
http://www.intex.com/troll/program.html
Once you have mastered that, you could get a job with Trolltech
or Troll Touch Touchscreens:
http://www.trolltech.com/
http://www.trolltouch.com/
--
--
Patrick Doyle
doylep@eecg.toronto.edu
------------------------------
Date: Tue, 06 Nov 2001 00:17:33 GMT
From: olczyk@interaccess.com (Thaddeus L Olczyk)
Subject: Re: Best language for low IQ programmers?
Message-Id: <3be72bcc.318820859@nntp.interaccess.com>
On Mon, 5 Nov 2001 23:37:03 GMT, doylep@eecg.toronto.edu (Patrick
Doyle) wrote:
>In article <1004990076967295@aol.com>, Brian Metc <BrianMetc@aol.com> wrote:
>>
>>Anyways, I want to go into computor programing because of money
>>issue. I now need to choose languege for programming, simple enough
>>for me.
>
>You may want to begin with the TROLL programming language:
>
> http://www.intex.com/troll/program.html
>
Can't be a very good language there's no download page for me to get
the interpreter/compiler/whatever. There's also no emacs mode for it.
------------------------------
Date: Tue, 06 Nov 2001 00:20:31 GMT
From: olczyk@interaccess.com (Thaddeus L Olczyk)
Subject: Re: Best language for low IQ programmers?
Message-Id: <3be82c8b.319011859@nntp.interaccess.com>
On Mon, 05 Nov 2001 23:09:21 +0000, Richard Heathfield
<binary@eton.powernet.co.uk> wrote:
>Brian Metc wrote:
>>
><snip>
>>
>> Would any one sugest the best language for me.
>
>APL.
I was thinking of CL with meta object protocol.
In fact I think he should start with The Art of The
Metaobject Protocol.
------------------------------
Date: Tue, 06 Nov 2001 00:23:34 GMT
From: olczyk@interaccess.com (Thaddeus L Olczyk)
Subject: Re: Best language for low IQ programmers?
Message-Id: <3be92d15.319149609@nntp.interaccess.com>
On Mon, 5 Nov 2001 13:54:36 -0600, BrianMetc@aol.com (Brian Metc)
wrote:
>My problem is that I have low IQ due to
>early childhool learning deprivation and TV overdose.
Well considering the fact that you haven't posted to Usenet
before ( according to google ), your IQ can't be that badly fried.
While many of the jobs that require programming do require
a high IQ I've met many a programmer whose low IQ does not
deter them.
Good luck.
------------------------------
Date: Mon, 5 Nov 2001 23:39:44 +0000
From: James Taylor <SEE_MY_SIG@nospam.demon.co.uk>
Subject: Re: Best language for low IQ programmers?
Message-Id: <ant052344d07fNdQ@oakseed.demon.co.uk>
In article <3be6fcf8$1@news.sentex.net>, Mario Grgic wrote:
>
> I say, wait till someone writes a cross platform compiler
> for English. Then you'll have a chance.
I'm not so sure. Did you notice his use of English?
Hardly a sentence without a spelling error!
There's unlikely ever to be a compiler capable
of coping with that.
--
James Taylor <james (at) oakseed demon co uk>
Based in Southam, Cheltenham, UK.
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Tue, 06 Nov 2001 00:34:51 GMT
From: "TheStonge" <stonge81@hotmail.com>
Subject: Re: Best language for low IQ programmers?
Message-Id: <LeGF7.7172$Y6.451739@news1.rdc1.ct.home.com>
Try Assembly Language :-D
------------------------------
Date: 5 Nov 2001 16:46:00 -0800
From: byhoe@greenlime.com (Adrian Hoe)
Subject: Re: Best language for low IQ programmers?
Message-Id: <9ff447f2.0111051646.9fb23c5@posting.google.com>
BrianMetc@aol.com (Brian Metc) wrote in message news:<1004990076967295@aol.com>...
> I would like to get into the programing field. My problem is that I have low IQ due to
> early childhool learning deprivation and TV overdose. Simply said I am stuped, I am
> pretty good amongst my friends, but not solving problems. You know what I
> mean. Anyways, I want to go into computor programing because of money
> issue. I now need to choose languege for programming, simple enough
> for me.
>
> My friend wh does C plus plus recommended that I learn either Visual Basic or Eiffel.
> My ex girlfriend who is a sys admin who did perl, sugested that I learn Ada because
> it has "serious type system" which is fool proof.
>
> She dis couraged me from using Eiffel because itr was a language going out of the
> market, no longer used by any serious corporation, She said the same thing for Ada.
>
> Java is simple compared to c plus plus but a scam language, based on hype.
>
> This only leaves visual basic. Especally because it is used under Windows, Microsoft
> stuff is always easier.
>
> Would any one sugest the best language for me.
>
> Brian
Brian,
No one is stupid in this world! It is only stupid if you think you
are. Learn Ada and you will never regret it. It is not difficult to
learn but only time that's matter.
I have many colleagues in my work place have not even got into
college. But their interest in computer and perseverence make them
software engineer today. They use Ada in their daily programming
chores.
Get a book teaching Ada for a start and you will find Ada is very
different from others.
Go ahead. You can make it!
------------------------------
Date: 5 Nov 2001 19:13:27 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Best language for low IQ programmers?
Message-Id: <9s7dfn$63$1@charity.cs.utexas.edu>
In article <9s6tbl$ga2$1@hpcvnews.cv.hp.com>,
<arnet@hpcvplnx.cv.hp.com> wrote:
>Anyway, all computer languages are the same conceptually. One either
>"gets" the concept of giving a machine a list of instructions to follow,
>or one doesn't.
I don't know that I quite agree with that. Prolog isn't the same
conceptually as assembly language. Neither is a pure functional
programming language. Or maybe it is true if you think of Prolog
as having an implicit "tell me whether this is true" instruction
and pure functional languages as having an implicit "tell me the
value of this" instruction. But that's kind of a stretch.
Anyway, if the original poster is looking for a programming language
for stupid people, they should check out http://www.cobolscript.com/ .
- Logan
--
"In order to be prepared to hope in what does not deceive,
we must first lose hope in everything that deceives."
Georges Bernanos
------------------------------
Date: Tue, 06 Nov 2001 01:53:58 GMT
From: "Mike Mackay [Ultrafusion]" <newsgroup_mike@ultrafusion.co.uk>
Subject: Dynamically Assigning Scalars On The Fly
Message-Id: <WoHF7.2919$Yk5.507617@news1.cableinet.net>
I have a 2 line csv file, displayed below as follows :
first,last,country
Mike,Mackay,England
What I want my perl script to do is take the top line, and change each one
of the field names into a scalar to reference it's value, for example my
script would now have the following scalars : $first, $last, & $country.
I would then have a print statement in my script just like the following :
print "$first $last, comes from $country";
and it should output : "Mike Mackay, comes from England".
However I want this script to create the scalars and assign the data
automatically for any csv file with any amount of fields without me having
to open up the script and manually enter the scalar names. Can anyone offer
any help of how I should go about : a) creating the scalars on the fly, and
b) assigning a value to that scalar.
I know how to open the script and get the top line only etc. It's just this
dynamically assigned scalars that I can't figure out. If you need a further
explanation then I can provide more info. Thanks for any advice/help.
Regards,
Mike Mackay.
------------------------------
Date: 5 Nov 2001 17:52:43 -0800
From: weiwe1@yeah.net (hugh1)
Subject: helo!
Message-Id: <7dcf30ba.0111051752.52f732e8@posting.google.com>
#!/usr/local/bin/perl -wT
print"Content-type: text/html";
my $var_name;
foreach $var_name (sort keys %ENV) {
print "<P><B>$var_name</B></P>";
print $ENV{$var_name};
}
this cgi program on the server B, i use netscape (on workstation A)
location: http://serverB/cgi-bin/do_charge.cgi
it is display " Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request"
if i telnet B from A ,and do it as " ./do_charge.cgi ". it display
"# ./do_charge.cgi
Content-type: text/html<P><B>DISPLAY</B></P>ghost.dbwindow.com:0<P><B>HOME</B></P>/ex
port/home/gulong<P><B>HZ</B></P>100<P><B>LOGNAME</B></P>gulong<P><B>MAIL</B></P>/var/
mail/gulong<P><B>PATH</B></P>/usr/sbin:/usr/bin<P><B>PS1</B></P>#
<P><B>SHELL</B></P>
/bin/sh<P><B>TERM</B></P>xterm<P><B>TZ</B></P>PRC<P><B>_INIT_PREV_LEVEL</B></P>S<P><B
"
it looks maybe right!! but why i can not get this answer on my nescape
(workstation A)
------------------------------
Date: Mon, 05 Nov 2001 20:59:24 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Is \n\n safe for http?
Message-Id: <3BE743FC.B63983E9@earthlink.net>
rihad wrote:
>
> Hi there.
>
> All of us have no doubt frequently seen the
> print "Content-Type: text/html\n\n";
> line in perl cgi scripts. But I've been reading rfc2616 (HTTP) and it
> says that each header must end in a CRLF sequence which must be
> ASCII(13) ASCII(10), and the headers section itself must end in a
> CRLF. Is it safe to assume that \n will expand to CRLF??
Indirectly, the \n will be expanded to CRLF, though not the way you're
thinking.
The CGI specifications require that when the httpd is recieving headers
from a CGI program, it use your system's newline sequence [whatever that
may be] as the delimiter to tell what a line is, and when the httpd
constructs the outgoing headers, it always uses a proper CRLF to delimit
them, even if CRLF isn't the system's newline.
So the problem becomes getting your CGI headers to have "proper"
newlines between them... is "\n" right for this? Yes.
Perl will, if STDOUT doesn't have binmode set on it, translate \n chars
into the system's newline characters [if necessary. On unix and mac,
the \n already is the system newline character, so it doesn't need to be
changed on output. On win, \n [within perl] means chr(10), and upon
output in ascii mode, any chr(10) gets translated into chr(13).chr(10),
which is the system's newline sequence]
--
Klein bottle for rent - inquire within.
------------------------------
Date: Tue, 06 Nov 2001 01:48:17 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: One for the Perl Wizards...
Message-Id: <slrn9uedjl.8fa.tadmc@tadmc26.august.net>
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>Don't put multiple comments on one line.
s/comments/statements/; # is what I'm sure Martien meant
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 Nov 2001 23:03:41 GMT
From: "Marianne Sisto" <msisto@chat.carleton.ca>
Subject: Re: Please help beginner with using cookies!
Message-Id: <9s75sd$kuu$1@bertrand.ccs.carleton.ca>
Yes I know, but its for an assignment! I am not allowed to use somebody
else code!
"Tintin" <tintin@snowy.calculus> wrote in message
news:WnCF7.1$Y65.104551@news.interact.net.au...
>
> "Marianne Sisto" <msisto@chat.carleton.ca> wrote in message
> news:9s4c2j$4qs$1@bertrand.ccs.carleton.ca...
> > Thank you
> >
> > "Mark Taylor" <mtaylor@lrim.com> wrote in message
> > news:Xns914F96EFD1728maintainersetifaqorg@128.242.171.114...
> > > "Marianne Sisto" <msisto@chat.carleton.ca> wrote in
> > > <9s47kh$1al$1@bertrand.ccs.carleton.ca>:
> > >
> > > >Hi, I have a question about cookies. I need to create multiple
> cookies,
> > > >one for each person who 'logs on' to my website so it should store
the
> > > >userID for example - this is no problem I can do this part. But,
when
> > > >the person logs on AGAIN, I then need to read these cookies and find
> the
> > > >one containing their ID and then display other information stored in
> the
> > > >cookie - is there a way to do this? Like read a certain field of
each
> > > >cookie such as userID, until I find the one I want, and then read the
> > > >rest of the information? Or is there a simpler way to do this?
> > > >Thank you
> > > >
> > > >
> > > >
> > > >
> > >
> > > As I understand cookies, you will be writing one cookie per visitor to
> > your
> > > site, on his computer, not yours. And you can store multiple values in
a
> > > cookie like in...
> > >
> > > print "Set-cookie: user$COOKIE_ID=$username_in; expires=Tuesday,
> > 4-Jul-2000
> > > 12:00:00 GMT; path=/\n";
> > >
> > >
> > > And you can read and parse the values with something like:
> > >
> > > sub read_cookie {
> > > $buffer = $ENV{'HTTP_COOKIE'};
> > > @pairs = split(/; /, $buffer);
> > > foreach $pair (@pairs) {
> > > ($name, $value) = split(/=/, $pair);
> > > $value =~ tr/+/ /;
> > > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> > > $COOKIE{$name} = $value;
> > > }
> > > }
> >
> > Hi, thank you for that information. I have to write the code myself
rather
> > than use a module though.
>
> Why reinvent the wheel? You have a standard module that comes with all
> modern versions of Perl that will handle most cookie operations.
>
> > Also, I need to store for each user, a list of courses. I have these
> > courses stored in an array. How can I store the data from an array into
a
> > cookie?
>
> Look at the CGI.pm documentation
>
>
>
------------------------------
Date: Mon, 05 Nov 2001 20:14:36 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Please help with simple script
Message-Id: <3BE7397C.1DCD81F5@earthlink.net>
Tassilo von Parseval wrote:
>
> Terry wrote:
>
> > Hello,
> >
> > Could someone help converting this to perlscript?
> >
> > Thanks in advance,
> > Terry
> >
> > ==========================================
> > Dim domain1, domain2, domain3, domain4, refDomain
> >
> > refDomain = Request.ServerVariables("HTTP_REFERER")
> > domain1 = inStr(refDomain,"http://www.domain1.com")
> > domain2 = inStr(refDomain,"http://www.domain2.com")
> > domain3 = inStr(refDomain,"http://www.domain3.com")
> > domain4 = inStr(refDomain,"http://www.domain4.com")
> >
> > If domain1 <> True And domain2 <> True And domain3 <> True And
> > domain4 <> True Then
> > Response.Write("Error.<br><br>This script cannot be run from this
> > domain.")
> > Response.End
> > End If
>
> I am not really a VB-hacker but from what I think: [untested]
>
> #! /usr/bin/perl -wT
>
> use strict;
> print "text/html\n\n";
> if ($ENV{HTTP_REFERER} !~ /http:\/\/www\.domain[1-4]\.com/) {
> print <<EOHTML;
> Error.
> <br><br>
> This script cannot be run from this domain.
> EOHTML
> }
>
> Hmmh, how much nicer this is!
The regex suffers from leaning-toothpick-syndrome. Use a different
quote character. Also, you should anchor the regex... otherwise,
someone might have a referer of www.domain1.com.foo.bar.org, and you
would consider it valid.
#! /usr/bin/perl -wT
print "text/html\n\n";
unless( $ENV{HTTP_REFERER} =~ m[^http://www\.domain[1-4]\.com($|/)] ) {
print "Error.\n<br><br>\n";
print "This script cannot be run from this domain.\n";
exit;
}
I feel that I should also mention that many browsers don't send a
referer header, so this kind of code may annoy legitimate users, and it
will do very little to stop illegitimate users, since the referer header
is trivial to fake.
--
Klein bottle for rent - inquire within.
------------------------------
Date: Tue, 06 Nov 2001 01:24:56 GMT
From: W i l l <willis3140@yahoo.com>
Subject: regex help please
Message-Id: <nteeuts03n2u09v1kb0t8plo2sglprrqfc@4ax.com>
I was given an Access database which I am trying to get into MySQL, I
read through the documentation on mysqlimport and it said that it was
only capable of importing text files. So I export my Access DB into a
pipe delimited file, pipes delimiting the fields, and newlines
delimiting the records. Well, to make a long story short, M$ Access's
Export feature sucks, many of my rows were divided on whitespaces
which resulted single lines looking like the following
3884|MC1|GW|Graphworks/Mirandas Needle|kit
|Mice Skating|EACH|$1.50|$0.75|MC1.JPG
My question is, how do I remove the newline '\n' on a line if the next
line doesn't start with a 3-5 digit number and then print that new
complete line to a seperate file?
This is what I have so far, and it doesn't work.
open (PROD,"<products.txt");
open (OUT,">out.txt");
@array = <PROD>;
foreach $line (@array){
unless ($line =~/JPG?/){ chomp; }
print OUT "$line"; }
any help would be appreciated.
------------------------------
Date: 5 Nov 2001 20:00:33 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: regex help please
Message-Id: <9s7g81$nm$1@charity.cs.utexas.edu>
In article <nteeuts03n2u09v1kb0t8plo2sglprrqfc@4ax.com>,
W i l l <willis3140@yahoo.com> wrote:
>I was given an Access database which I am trying to get into MySQL, I
>read through the documentation on mysqlimport and it said that it was
>only capable of importing text files. So I export my Access DB into a
>pipe delimited file,
:
:
>which resulted single lines looking like the following
>
>
>3884|MC1|GW|Graphworks/Mirandas Needle|kit
>|Mice Skating|EACH|$1.50|$0.75|MC1.JPG
>
>
>My question is, how do I remove the newline '\n' on a line if the next
I suggest that you don't. Instead, write a Perl program
that connects to both databases (using DBI, DBD-mysql, and
DBD-ODBC), does a "select * from foo" for each Access
table, and then inserts the results into the mysql tables.
Or if you can't do that (which you should be able to), have Perl
extract everything from the database and then use something like
Data::Dumper to spit it into a file format that Perl can handle. Then
transfer that, suck it back in, and spit it into the target database.
Or use one of those programs that's specifically designed
to transfer tables between different databases.
- Logan
--
"In order to be prepared to hope in what does not deceive,
we must first lose hope in everything that deceives."
Georges Bernanos
------------------------------
Date: Tue, 06 Nov 2001 00:28:42 +0100
From: Tassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Sending Content Type in email
Message-Id: <3BE720AA.7020202@post.rwth-aachen.de>
Stuart Gall wrote:
> "Glenn White" <spam.killer@home.com_nospam> wrote in message
>>Thanks for the info. The change request is actually a case of scope creep
>>and was not in the original specs. I will heed Tassilo's suggestions:
>>Either they can do it or submit it as a new request to create a
>>"multipart/alternative email ." Otherwise, the best suggestion is, "But
>>don't do it and instead leave the font used as a choice for the
>>
> recipient."
>
> You can also use text/html type. You are not realy supposed to (I think) so
> perhaps it should not be done on internet. but I use text/html on most of
^^^^^^^^^^^^^^^^^^^^^
> the automailer scripts on our intranet, it works fine and it is very easy to
> change a text/plain script to text/html going to multipart alternative is a
> pain.
This indeed should not be done. Since using mutt as email-client, I
dislike any mails containing just an attachement. I have to press 'v'
first, then <RETURN>. After that, w3m is opened to render the page on
the console (which - since it is console - is sort of identical to a
text/plain mail). Then 'q', 'y' to confirm quitting, afterwards <any
key> and finally one of the arrow-keys to get back into mutt's inbox
view. This is a clear violation against longstanding console-tradition
of having to touch as few keys as possible to do somethinf useful.
I'd therefore strongly prefer the idea of the script's author taking the
pain on him to change a text/plain script to multipart/alternative
rather than doing the above odysee across my keyboard. ;-)
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 5 Nov 2001 19:15:46 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Sending Content Type in email
Message-Id: <9s7dk2$6t$1@charity.cs.utexas.edu>
In article <3BE720AA.7020202@post.rwth-aachen.de>,
Tassilo von Parseval <tassilo.parseval@post.rwth-aachen.de> wrote:
>This indeed should not be done. Since using mutt as email-client, I
>dislike any mails containing just an attachement. I have to press 'v'
>first, then <RETURN>. After that, w3m is opened to render the page on
>the console (which - since it is console - is sort of identical to a
>text/plain mail). Then 'q', 'y' to confirm quitting, afterwards <any
>key> and finally one of the arrow-keys to get back into mutt's inbox
>view.
I find it's much easier to just type "d", as in "delete".
- Logan
--
"In order to be prepared to hope in what does not deceive,
we must first lose hope in everything that deceives."
Georges Bernanos
------------------------------
Date: Tue, 06 Nov 2001 02:40:11 +0100
From: Tassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Sending Content Type in email
Message-Id: <3BE73F7B.8030903@post.rwth-aachen.de>
Logan Shaw wrote:
> In article <3BE720AA.7020202@post.rwth-aachen.de>,
> Tassilo von Parseval <tassilo.parseval@post.rwth-aachen.de> wrote:
>
>>This indeed should not be done. Since using mutt as email-client, I
>>dislike any mails containing just an attachement. I have to press 'v'
>>first, then <RETURN>. After that, w3m is opened to render the page on
>>the console (which - since it is console - is sort of identical to a
>>text/plain mail). Then 'q', 'y' to confirm quitting, afterwards <any
>>key> and finally one of the arrow-keys to get back into mutt's inbox
>>view.
>>
>
> I find it's much easier to just type "d", as in "delete".
But no! You might just delete a HTMLized love-confession of a pleasant
female human being.
You never knows. ;-)
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 5 Nov 2001 16:29:23 -0800
From: anand_ramamurthy@yahoo.com (Anand Ramamurthy)
Subject: Simple XML Parser example
Message-Id: <761041e6.0111051629.1f411a8f@posting.google.com>
I am trying to write a very simple XML parser, to parse an XML config
file. I am looking for a good example (perl script & corresponding data).
Also, I would like to use the simplest Perl module (self contained).
Thanks a bunch in advance.
------------------------------
Date: 5 Nov 2001 16:33:32 -0800
From: weiwe1@yeah.net (hugh1)
Subject: sorry !
Message-Id: <7dcf30ba.0111051633.7c473fd6@posting.google.com>
that is my posted message yestoday. i do not illustrate it clearly
sorry about it!!!
i want to know in perl programing how should call one cgi program which
maybe complied with C or some other languages.
how can i trans argv to it!!
>thanx!
> my english is poor! i try my best to let you know my question!
>
> now i have a tast to change my company's some CGI program.
>
> http://localhost/cgi-bin/charge.cgi...........
> one cgi-program "charge.cgi" function is add user's money. for
>example: on the web netscape, i save my account $100, and the CGI
>call charge.cgi to do it.and the web refresh, have not result
>stat output! but i check my account ,i find the action is done right.
>i want to add the result stat output!
> if charge.cgi is do ok! it is display "ok" on new web page.
> else display "wrong" web page!
> the charge.cgi maybe C compiled program. how can i do??
> thanx for your help!
> and i can not know which knowledge i should to learn !
------------------------------
Date: Mon, 05 Nov 2001 17:50:29 -0600
From: "David J. Ritchie" <ritchie@fnal.gov>
Subject: Re: Teaching Perl to Middle School Students
Message-Id: <3BE725C4.7F6FBDA0@fnal.gov>
Tintin wrote:
> "David J. Ritchie" <ritchie@svs.com> wrote in message
> news:3BE6E97B.69DF61F5@svs.com...
> ...
>
> Trying to teach any programming language in terms of English grammar is only
> going to confuse the students. Just as there are specific terms in English
> grammar, there are specific terms for programming languages. It doesn't
> make any sense to intermingle the two.
I appreciate your point of view. Though I can understand that you may feel
that it doesn't make much sense, it turns out it is helpful to Middle School kids
as a way of bridging from what they already know after 5 years of language arts
to what is present in programming languages. You will note that the Perl terms
of variable, block, etc. are introduced very quickly thereafter and subsequent
discussion is done in terms of those terms.
It also relates it to what else is being taught in the curriculum--not only
in language arts--but in introductory foreign languages.
--D.
You will note that the Perl terms are introduced shortly thereafter.
------------------------------
Date: Mon, 05 Nov 2001 18:02:55 -0600
From: "David J. Ritchie" <ritchie@fnal.gov>
Subject: Re: Teaching Perl to Middle School Students
Message-Id: <3BE728AF.7A6B3EEF@fnal.gov>
"Clayton L. Scott" wrote:
> I noticed that you neglegted to mention which IDE product you are using in your examples.
> Perhaps taht should be in an appendix "Supporting Materials"
Good point. Originally, the schools were using Macs (I think this was 1998) where
the Perl brings with it its own IDE. After the schools switched to WNT,
I went with a straight-forward use of Notepad as an editor and launching the
programs via a double click on the files created. I did not know of an IDE
for WNT in 1999 when the sessions were first run. There were also
security concerns that I had to overcome so keeping things to a
minmalist approach was important.
------------------------------
Date: 05 Nov 2001 19:58:00 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Teaching Perl to Middle School Students
Message-Id: <m3y9lkiulj.fsf@mumonkan.sunstarsys.com>
"David J. Ritchie" <ritchie@fnal.gov> writes:
> Tintin wrote:
>
> > "David J. Ritchie" <ritchie@svs.com> wrote in message
> > news:3BE6E97B.69DF61F5@svs.com...
> > ...
> >
> > Trying to teach any programming language in terms of English grammar
> > is only going to confuse the students. Just as there are specific
> > terms in English grammar, there are specific terms for programming
> > languages. It doesn't make any sense to intermingle the two.
>
> I appreciate your point of view. Though I can understand that you may
> feel that it doesn't make much sense, it turns out it is helpful to
> Middle School kids as a way of bridging from what they already know
> after 5 years of language arts to what is present in programming
> languages. You will note that the Perl terms of variable, block,
> etc. are introduced very quickly thereafter and subsequent
> discussion is done in terms of those terms.
I thought your approach made a lot of sense- it reminded me
immediately of my middle school age sentence diagrams, since
that's the only time in my life that they actually mattered :)
I also thought the approach of modifying a prewritten program was
a very good idea. The more real Perl code they are working with,
the more successful your course is bound to be.
Now some criticisms:
1) Maybe you could make better use of space; in places it looked to me
like the comments were detracting from the program flow. Try adding
some newlines or moving some comments to the right side of a
statement would look better. Or have the students fill in some
of the comments themselves, like
$A = <STDIN>; # what does this do? __________________________________
2) Adding a shebang line like
#!/usr/bin/perl -w
use diagnostics;
at the top of each program would be nice, even if you don't bother
to explain what it does. Also, I don't think it would hurt to quickly
wean them off the "single thing" language and call them "scalars".
That's how a math teacher would use the term, so you're killing two
birds with one stone :)
3) No variable declarations using "my", no "use strict"
I'm not sure if this criticism is really appropriate for middle
school aged programmers, but it's a very good habit. It might
be nice to introduce them at some later point in the course.
Lastly, one suggestion: some "find the bug" exercises might also
be useful. Give a description of what the program is supposed to
do, and let them figure out what went wrong; use Perl's diagnostic
messages for hints. Include things like syntax errors, precedence
errors, off-by-one errors, "= when you meant ==" errors, and
misapplication of deMoivre's rule (hmm, that one rings a bell :).
Good luck.
--
Joe Schaefer "It is better to be feared than loved, if you cannot be both."
-- Niccolo Machiavelli
------------------------------
Date: Mon, 05 Nov 2001 20:35:36 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Wrapping long emails - sample code
Message-Id: <3BE73E68.B36B2FE7@earthlink.net>
Philip S Tellis wrote:
>
> Just thought that some people may be interested in this code. I use
> it to wrap long lines in emails that I receive.
[snip]
> s/^((?:[>}|%]\s?)+)(\s*)//o;
> my $leadin = $1 || "";
> my $leadin_firstline = $leadin . ($2 || "");
> $_ = Text::Wrap::wrap($leadin_firstline, $leadin, $_);
Have you looked into using Text::AutoFormat ?
perl -MText::Autoformat -eautoformat
--
Klein bottle for rent - inquire within.
------------------------------
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.
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 2074
***************************************