[15965] in Perl-Users-Digest
Perl-Users Digest, Issue: 3377 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 15 18:16:04 2000
Date: Thu, 15 Jun 2000 15:15:42 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961107341-v9-i3377@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 15 Jun 2000 Volume: 9 Number: 3377
Today's topics:
Re: curious databse of webhosting like geocities (Abigail)
Determining Dates reedjd@bitsmart.com
Re: Does anyone have some exercises? <care227@attglobal.net>
Re: Does anyone have some exercises? (Tad McClellan)
Re: Does anyone have some exercises? <care227@attglobal.net>
Re: Does anyone have some exercises? <brent.schenk@home.com>
Re: file download over cgi script <sowiso@snailsen.de>
Re: Form <brent.schenk@home.com>
Re: Form <care227@attglobal.net>
Graphics files gd.pm and gd.dll <bobsingh1@hotmail.com>
Re: help: split pattern (Tad McClellan)
Re: help: split pattern <brent.schenk@home.com>
Re: how do I "redirect" a substitution? (Bart Lateur)
how do i ignore special chars in a string? <helza@planet.nl>
Re: how do i ignore special chars in a string? <care227@attglobal.net>
Re: how do i ignore special chars in a string? <helza@planet.nl>
Re: how do i ignore special chars in a string? <tony_curtis32@yahoo.com>
Re: how do i ignore special chars in a string? <care227@attglobal.net>
Re: how do i ignore special chars in a string? <lauren_smith13@hotmail.com>
Re: How to capture screen that uses curses (Sylvain Dumas)
How to decode binhex encoded email attachments? (ahy)
Re: how to find what modules are available in a server <steve@ace-internet.co.uk>
MacPerl- Back to square one. <hyagillot@tesco.net>
Re: module fields <rootbeer@redcat.com>
Re: module fields <care227@attglobal.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Jun 2000 16:27:20 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: curious databse of webhosting like geocities
Message-Id: <slrn8kig3i.jil.abigail@alexandra.delanet.com>
Daniel van den Oord (danielxx@bart.nl) wrote on MMCDLXXX September
MCMXCIII in <URL:news:tg725.1375$%h3.28429@Typhoon.bART.nl>:
** I'm curious what kind of database geocities uses to store the info of their
** users
Well, that may, or may not be an interesting question.
However, it's totally off topic in this group. Perhaps you should use
a different medium. Try contacting geocities.
Abigail
--
perl -Mstrict -we '$_ = "goto N.print chop;\n=rekcaH lreP rehtona tsuJ";N1:eval'
------------------------------
Date: Thu, 15 Jun 2000 20:56:51 GMT
From: reedjd@bitsmart.com
Subject: Determining Dates
Message-Id: <8ibfu9$erd$1@nnrp1.deja.com>
I'm attempting to write a Perl program that can determine if it is the
last weekday of the month.
Obviously I can use localtime(time) to figure out what day of the month
it is and if it's a weekday or not, but is there any way in Perl to
determine the total number of days a month taking leap years into
account?
-jr
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 15 Jun 2000 14:06:04 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Does anyone have some exercises?
Message-Id: <39491B0C.36F7A757@attglobal.net>
"E.C.vEersel" wrote:
>
> Good day everybody,
>
> I tried to track down some exercises on the WWW, but no elaborate "exercise
> page" was to be found. Can someone help me out here? Does anyone has
> some old homework problems around in a dusty drawer? I'd like to test my
> knowledge by making some exercises that I don't define myself.
>
Best place is right here. I look at all the problems others post
(and I mean all.. read every post and every reply if you can).
Try to work solutions to these problems, and then compare against
what the pro's come up with. (don't worry about falling short, I've
been tinkering with Perl for a bit over a year now, and I'm daily amazed
at how much I _don't_ know.)
Its a good excercise, and the answers posted by the experts are
generally not only correct, but using refined styles. See if
it works out for you...
------------------------------
Date: Thu, 15 Jun 2000 14:10:35 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Does anyone have some exercises?
Message-Id: <slrn8ki70r.7c8.tadmc@magna.metronet.com>
On Thu, 15 Jun 2000 17:42:32 GMT, E.C.vEersel <E.C.vEersel@KUB.NL> wrote:
>A couple of days ago I decided to learn Perl.
>Does anyone has
>some old homework problems around in a dusty drawer? I'd like to test my
>knowledge by making some exercises that I don't define myself.
I used two approaches when confronted with the same problem.
1) comp.lang.perl.* newsgroup postings
read only the root of a thread (i.e. the question).
write a solution in Perl
read the followups and compare to your solution
2) rewrite common system utilities in Perl
write 'ls' (or 'dir' if you live in servitude)
modify it to get the differing behaviors that ls gives you:
ls # columnated
ls > ls.output # one file per line
modify it for 'ls -a'
...
You can compare your code to the Perl code at:
http://language.perl.com/ppt/
You can even modify #1 so that you _post_ your solution, then
watch as it gets torn down and redone :-)
Nothing like public embarrassment to "bring home" a lesson.
I've embarrassed myself here dozens of times (the last was
a couple of hours ago), and every single time I came away
a better Perl programmer.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 15 Jun 2000 15:24:20 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Does anyone have some exercises?
Message-Id: <39492D64.FDF1CF5A@attglobal.net>
Tad McClellan wrote:
>
>
> You can even modify #1 so that you _post_ your solution, then
> watch as it gets torn down and redone :-)
>
Oh the pain. The shame and the pain. Hmm..
I think I've only mumbled "I'm a moron" 5 times so far today, and
only 4 were because of foolish postings.
I'm improving so much.
------------------------------
Date: Thu, 15 Jun 2000 14:57:00 -0500
From: "Brent Schenk" <brent.schenk@home.com>
Subject: Re: Does anyone have some exercises?
Message-Id: <3949348e.0@news>
I learned by starting out my own webpage and just adding to it. Make a
counter, make a news script so that putting news on the main page is simple
and the news updates are in a database of dates, time, and the article. Try
to make a guestbook. I learned Perl as I needed it for my own website.
It's at http://cmarena.telefragged.com The news script is on the front, the
models are kept in perl databases, and there is a counter at the top. I
didn't write the messageboards because the ones i use are absolutely
awesome!
E.C.vEersel <E.C.vEersel@KUB.NL> wrote in message
news:8ib4i8$hka$1@mailnews.kub.nl...
> Good day everybody,
>
> A couple of days ago I decided to learn Perl. I bought a book that several
> people advised me: Programming Perl, by Wall, Christiansen and Schwartz.
The
> book is great: clear explanation, funny and clearly arranged. The only
> disadvantage is the fact that there aren't any exercises at the end of the
> chapter, as in Learning Perl (it is after all more like a reference than
it is
> a tutorial).
>
> I tried to track down some exercises on the WWW, but no elaborate
"exercise
> page" was to be found. Can someone help me out here? Does anyone has
> some old homework problems around in a dusty drawer? I'd like to test my
> knowledge by making some exercises that I don't define myself.
>
> Cordially,
>
> Casper van Eersel
> E.C.vEersel@kub.nl
------------------------------
Date: Thu, 15 Jun 2000 22:12:38 +0200
From: Nils =?iso-8859-1?Q?Sch=E4le?= <sowiso@snailsen.de>
Subject: Re: file download over cgi script
Message-Id: <394938B6.3D9E4242@snailsen.de>
scott thomason wrote:
>
> Don't run this script as-is without first reading a good chapter or two on CGI security.
> You are in essence allowing anyone to execute a command under the webserver
> user-id by taking arbitrary content from param('filename').
In the final script i check first if the param is a valid file in a
specified
directory on the server, so no need for panic ;-). i've just write it in
that
way for my posting to reduce the script to the relevant part.
> A much better solution is to just stuff the download-able files somewhere under your
> web doc root and just let them click on the file in a directory listing.
thats exactly what i NOT wanted to do cause the script checks who wants
to download
and should not give everybody access to the files. that for a redirect
is also not possible.
cu Nils
> If you *NEED* to automate it for some reason, you can still use your script, but
> change it do to a redirect to a downloadable URL. Then you don't have to worry
> about CGI security as much.
> ---scott
------------------------------
Date: Thu, 15 Jun 2000 15:04:54 -0500
From: "Brent Schenk" <brent.schenk@home.com>
Subject: Re: Form
Message-Id: <39493668.0@news>
if you know perl it'll be easy, if you don't.....good luck
Tek <tekahera@my-deja.com> wrote in message
news:8iarrb$uej$1@nnrp1.deja.com...
> Hi,
> I'm working on an online form for a friend who has a mediation agency.
> I need a script that will do the following: if the user answers to the
> questions a certain way (yes, no, whatever to specific questions), the
> e-mail will be sent to the agency. If he answers differently, he will
> be brought to another page where he will be told that the agency can
> not help him and it will provide him with links to other places more
> appropriate for his/her case.
>
> Is this easy? complicated? is there a place where I could find such
> scripts?
>
> Thank you,
> Tekahera
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Thu, 15 Jun 2000 16:19:31 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Form
Message-Id: <39493A53.ADD53FB5@attglobal.net>
Brent Schenk wrote:
OK, thats the third post and its making me crazy.
The natural flow of human conversation is question followed by answer.
You are posting answer followed by question. This is known as Jeopardy
posting, and is considered bad form. Please refrain and use proper
posting form.
TIA
------------------------------
Date: Thu, 15 Jun 2000 11:22:04 -0700
From: Bobby Singh <bobsingh1@hotmail.com>
Subject: Graphics files gd.pm and gd.dll
Message-Id: <39491ECC.E98435B@hotmail.com>
I need gd.pm and gd.dll from Perl 5 for windows NT. I need it for
graphics and cannot find in the default perl package or if someone can
direct me where to get these files.
Bobby
------------------------------
Date: Thu, 15 Jun 2000 13:55:19 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: help: split pattern
Message-Id: <slrn8ki647.7c8.tadmc@magna.metronet.com>
On Thu, 15 Jun 2000 17:30:59 GMT, andrew_ef@my-deja.com <andrew_ef@my-deja.com> wrote:
>Hmmm, my first time using deja discussion groups.
This is NOT a "deja discussion group".
Deja only provides an _interface_ to Usenet, it does not "own" any of it.
(and a rather poor interface at that. If you plan to use Usenet much,
get a purpose-built newsreader program (see the
news.software.readers newsgroup).
)
This is a Usenet newsgroup. Every post goes to *tens of thousands*
of computers around the world, so repeating already answered
questions (FAQs) is a huge waste of resources.
Let's save the resources for UNanswered questions :-)
If you want to get the most from Usenet, you should monitor:
news.announce.newusers
for a couple of weeks.
------------------------------------------------------------------------
In article <1995Nov9.193745.13694@netlabs.com>, lwall@netlabs.com (Larry
Wall) wrote: ...
<Larry> [snip] I view a programming language as a place to be
<Larry> explored, like Disneyland. You don't need to have a lot of preparation
<Larry> to explore a theme park. You do have to go along with the crowd
<Larry> control measures, though. In a sense, each ride has its own
<Larry> prerequisites--if you cut in line, you risk getting tossed out of the
<Larry> park.
<Larry>
<Larry> What we have here in this newsgroup is a failure in crowd control.
<Larry> Reading the FAQ is like staying in line--it's something you should
<Larry> learn in kindergarten. Usenet needs a better kindergarten.
------------------------------------------------------------------------
news.announce.newusers is the best approximation to kindergarten
that we have, so use that :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 15 Jun 2000 14:58:36 -0500
From: "Brent Schenk" <brent.schenk@home.com>
Subject: Re: help: split pattern
Message-Id: <394934ee.0@news>
could you change it so that it is split up by | or something else that isn't
used!
<andrew_ef@my-deja.com> wrote in message news:8iaudm$hc$1@nnrp1.deja.com...
> I'm new at regular expressions and pattern matching and
> have been having trouble trying to do the following.
>
> I want to split a line of text at each comma, except those commas
> that appear between quotes in the string.
>
>
> For example, the following string:
>
> 1234,"hello","this is",56,789,"a, string","10111","and, more!",1314
>
>
> Should be split into:
>
> 1234 "hello" "this is" 56 789 "a, string" "10111" "and, more!" 1314
>
>
> If anyone can lend a hand I'd appreciate it!
> Thx!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Thu, 15 Jun 2000 20:19:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: how do I "redirect" a substitution?
Message-Id: <394c3a2a.4194127@news.skynet.be>
webqueen wrote:
> $s2=$s1;
> $s2 =~ s/cat/mouse/;
>
>Is there a way to do the last 2 lines in one statement?
($s2 = $s1) =~ s/cat/mouse/;
--
Bart.
------------------------------
Date: Thu, 15 Jun 2000 21:40:04 +0200
From: "Helza" <helza@planet.nl>
Subject: how do i ignore special chars in a string?
Message-Id: <8ibbej$68vgo$1@reader4.wxs.nl>
Hi,
i've written a little script which checks if a directory/file exists and if
it doesn't exist it will create the directory and a file in it..
now is the problem that i'm running on a NT machine and for example the
directory i'm trying to make is: e:\df-le\web\test
if i use $dir = "e:\df-le\web\test"; perl won't accept if because of the
special chars in it..
I tryed almost everything i could think up to ignore them but failed to
succeed :(
can anyone please tell me what i should fix (or command i should use) in the
following code:
-------------
#!/usr/bin/perl -w
$site = shift;
$dir = "e:\df-le\web\cgi-bin\";
$url = $dir . $site;
$complete = $url . "\index.html";
print "Content-type: text/html\n\n";
if (-e $complete) {
print "<BR> Sorry $complete already exists please choos another url";
}
else {
@command = ('MD $url');
system @command;
open (INVOER, '>$complete');
print INVOER "<title>$site succeeded</title>";
print "<BR> Site $complete created";
close INVOER;
}
--------------------
Anyone? :)
Greetings Helza
------------------------------
Date: Thu, 15 Jun 2000 15:51:54 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: how do i ignore special chars in a string?
Message-Id: <394933DA.A0379302@attglobal.net>
Helza wrote:
>
> Hi,
>
> i've written a little script which checks if a directory/file exists and if
> it doesn't exist it will create the directory and a file in it..
>
> now is the problem that i'm running on a NT machine and for example the
> directory i'm trying to make is: e:\df-le\web\test
> if i use $dir = "e:\df-le\web\test"; perl won't accept if because of the
> special chars in it..
Brush up on quoting and how it relates to interpolation.
I think $dir = 'e:\df-le\web\test'; ought to do the trick.
------------------------------
Date: Thu, 15 Jun 2000 22:05:14 +0200
From: "Helza" <helza@planet.nl>
Subject: Re: how do i ignore special chars in a string?
Message-Id: <8ibcu3$8h34i$1@reader3.wxs.nl>
oeps sorry..
i was being stupid :(
tryed everything except e:\\df-le\\cgi-bin\\ etc etc :(
sorry
------------------------------
Date: 15 Jun 2000 15:14:11 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: how do i ignore special chars in a string?
Message-Id: <87n1kmitws.fsf@limey.hpcc.uh.edu>
>> On Thu, 15 Jun 2000 22:05:14 +0200,
>> "Helza" <helza@planet.nl> said:
> oeps sorry.. i was being stupid :(
> tryed everything except e:\\df-le\\cgi-bin\\ etc etc :(
Jut use single quotes
'e:\path\to\file'
or perl also understands / (as nature intended :-)
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Thu, 15 Jun 2000 16:17:05 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: how do i ignore special chars in a string?
Message-Id: <394939C1.D07DDC89@attglobal.net>
Helza wrote:
>
> oeps sorry..
>
> i was being stupid :(
>
> tryed everything except e:\\df-le\\cgi-bin\\ etc etc :(
>
> sorry
No need to be sorry. As long as you learn. I think the theme for
today is "we all make silly mistakes", the point is to learn from,
instead of repeating, those mistakes.
$ perldoc perlop (on UNIX systems)
------------------------------
Date: Thu, 15 Jun 2000 13:16:04 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: how do i ignore special chars in a string?
Message-Id: <8ibdgr$6tf$1@brokaw.wa.com>
Drew Simonis <care227@attglobal.net> wrote in message
news:394933DA.A0379302@attglobal.net...
> Helza wrote:
> >
> > now is the problem that i'm running on a NT machine and for example the
> > directory i'm trying to make is: e:\df-le\web\test
> > if i use $dir = "e:\df-le\web\test"; perl won't accept if because of the
> > special chars in it..
>
> Brush up on quoting and how it relates to interpolation.
>
> I think $dir = 'e:\df-le\web\test'; ought to do the trick.
As will the secret that MS doesn't want you to know about:
$dir = "e:/df-le/web/test";
<secret>Forward slashes can be used, just like in Unix</secret>
sshhh. Tell everybody.
Lauren
------------------------------
Date: Thu, 15 Jun 2000 18:45:41 GMT
From: s.dumas@videotron.ca (Sylvain Dumas)
Subject: Re: How to capture screen that uses curses
Message-Id: <39492421.844283346@news.videotron.ca>
I'm looking for the same thing.
If you ever find anything, please let me know.
Thanks
Sylvain Dumas
s.dumas@videotron.ca
------------------------------
Date: Thu, 15 Jun 2000 21:52:27 GMT
From: ahyy@pacbell.net (ahy)
Subject: How to decode binhex encoded email attachments?
Message-Id: <39494fd2.8114515@client.sw.news.psi.net>
I really need help on decoding binhex encoded email attachments.
Thankx.
------------------------------
Date: Thu, 15 Jun 2000 19:37:32 +0100
From: "AceInternet" <steve@ace-internet.co.uk>
Subject: Re: how to find what modules are available in a server
Message-Id: <394926d1.0@london.netkonect.net>
> how to find what modules are available in a server? Like CGI, DBI, IO etc
The best utility i've found for easily finding this and many other server
related things is to install the CGI script "Pearldiver". It's a single
stand alone perl script that you run from your browser. The link is below.
http://www.scriptsolutions.com/programs/free/perldiver/
-------------------
Ace Internet http://www.ace-internet.co.uk
Tel - 0870 740 7555 Fax 0870 740 5335
------------------------------
Date: Thu, 15 Jun 2000 22:50:28 +0100
From: "B Kemp" <hyagillot@tesco.net>
Subject: MacPerl- Back to square one.
Message-Id: <8ibj9k$l4b$1@barcode.tesco.net>
A Mac has appeared in my office and I'm supposed to do something with it.
There don't seem to be specific newsgroups, can't even seem to find an
active general one.
Help!
I must admit it has all sorts of nice tools and camel icons for your files -
and a very nice animated camel mouse pointer, but its all still a bit odd.
Nice bit was having lines with syntax errors gettin highlighted in the
Macperl tools. I have actually got it to do all the things I was after so
perhaps that's that.
I even have a European Mac keyboard, which doesn't sm to have a # sign!
To show how useless we were, we wondered why the mouse cable was too short
for us to be able to plug it in the back and use it. (We know now, answers
on a postcard ...)
So, if you want a question rather than idle chatter:-
Information? Where from?
I get the impression that standard CPAN modules stand no chance on a Mac-
true? false?
------------------------------
Date: Thu, 15 Jun 2000 11:08:10 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: module fields
Message-Id: <Pine.GSO.4.10.10006151107240.5301-100000@user2.teleport.com>
On Wed, 14 Jun 2000, ran tene wrote:
> We have problems using the 'fields' module.
>
> Some times it seems that the fields are not inherited correctly.
Please make a small, self-contained example program to show this behavior.
Armed with that, someone will surely be able to find and fix the bug.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 15 Jun 2000 14:29:49 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: module fields
Message-Id: <3949209D.3CBCE6FF@attglobal.net>
ran tene wrote:
>
> We have problems using the 'fields' module.
Why is this showing up under a thread with the subject of
"Anyone use Win32::IPROC - help"?
Did you hijack this thread or is my newsreader misbehaving?
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3377
**************************************