[16516] in Perl-Users-Digest
Perl-Users Digest, Issue: 3928 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 6 14:05:28 2000
Date: Sun, 6 Aug 2000 11:05:15 -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: <965585115-v9-i3928@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 6 Aug 2000 Volume: 9 Number: 3928
Today's topics:
"Location:" How to? <john@torontonian.com>
A program running every 24 hours <diab.litoNOdiSPAM@usa.net.invalid>
Re: A program running every 24 hours (David Efflandt)
a simple question <VTAM_203@email.msn.com>
Re: a simple question <flavell@mail.cern.ch>
Re: a simple question (Randal L. Schwartz)
Re: can i test cgi scripts on my own pc without a host? <john@torontonian.com>
Re: convert string from uppercase to lower case (Keith Calvert Ivey)
Re: Cookie on the server side <gellyfish@gellyfish.com>
Re: DBI database access problem <eichelbe@bellatlantic.net>
Re: Dereferencing correctly in regular expressions (Keith Calvert Ivey)
Re: Dreaded 500 message <gellyfish@gellyfish.com>
Re: Dreaded 500 message <flavell@mail.cern.ch>
Re: Editing.cfg file for use with anti-leech Perl scrip (David Efflandt)
Re: First Days of Perl (Newbie) <carvdawg@patriot.net>
Re: First Days of Perl (Newbie) <diab.litoNOdiSPAM@usa.net.invalid>
Re: Graphic in a search results page <gellyfish@gellyfish.com>
Re: How do I convert a decimal number to a binary strin <gellyfish@gellyfish.com>
Re: How do I send data to another Server ??? <gellyfish@gellyfish.com>
Re: How to show "tail -f" in browser (Colin Keith)
Re: IP spoofing (Colin Keith)
Re: Learning Perl, 2nd Ed. Exercises. How can I do them <gellyfish@gellyfish.com>
Re: Learning Perl, 2nd Ed. Exercises. How can I do them <john@torontonian.com>
Re: my what? <gellyfish@gellyfish.com>
Re: Need help fixing a PerlShop problem (Colin Keith)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 06 Aug 2000 17:52:15 GMT
From: Oktay <john@torontonian.com>
Subject: "Location:" How to?
Message-Id: <398DA4B8.B2050326@torontonian.com>
Hi!
I am trying to write frame script where the external links from a site
will be shown within a frame.
My challenge is when the visitors browser is not a frame capable one, it
will be redirected directly to the URL.
If I remember correctly there was a concept like
Location:http://domain.com
in perl.
I want to use this within <noframe></noframe> tags but I am not quite
sure how to implement the Location thing.
My code is like this
$url="http://foo.com";
...
print "<NOFRAMES>\n";
print "Location:$url\n\n";
print "</NOFRAMES>\n";
..
The output with a frame disabled browser(Opera) is like this
Location:http://torontonian.com
That means it just prints above line(no redirection).
Do I have to use something else (i.e. USE LWP etc) to make it work?
I thank all in advance.
Best Regards
------------------------------
Date: Sun, 06 Aug 2000 09:17:57 -0700
From: Diablito <diab.litoNOdiSPAM@usa.net.invalid>
Subject: A program running every 24 hours
Message-Id: <02e34e67.a8a91690@usw-ex0103-023.remarq.com>
Can anyone give me some lines of code to have a perl program
running every 24 hours.I know it was posted at least 100
times,my apologies.The problem is that I currently know just the
very basic of Perl and the previous posts about this topic
sounds like Chinese to me.Thanks anyone.
Mario
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Sun, 6 Aug 2000 17:16:55 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: A program running every 24 hours
Message-Id: <slrn8or7bp.sr6.efflandt@efflandt.xnet.com>
On Sun, 06 Aug 2000, Diablito <diab.litoNOdiSPAM@usa.net.invalid> wrote:
>Can anyone give me some lines of code to have a perl program
>running every 24 hours.I know it was posted at least 100
>times,my apologies.The problem is that I currently know just the
>very basic of Perl and the previous posts about this topic
>sounds like Chinese to me.Thanks anyone.
>
>Mario
It is not a Perl question, it depends upon your OS. See 'man 5 crontab'
for Unix, or there is a scheduler icon in the taskbar in Win95 Plus or
Win98 (the thing that can do scandisk and defrag).
If all else fails try: sleep 86400;
But that will fail if you reboot your computer.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sun, 6 Aug 2000 09:31:10 -0700
From: "VTAM_203" <VTAM_203@email.msn.com>
Subject: a simple question
Message-Id: <uZ#TcM8$$GA.192@cpmsnbbsa09>
I have a script for a class from one of my perl books. There's one line in
it I don't understand.
Here's the script for the constructor of this class:
sub new {
my $proto = shift; # allow use as a class or object method
my $class = ref($proto) || $proto;
return bless({}, $class);
}
Can anybody explain to me what the "my $class = ref($proto) || $proto
statement does"?
------------------------------
Date: Sun, 6 Aug 2000 18:44:28 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: a simple question
Message-Id: <Pine.GHP.4.21.0008061840580.25484-100000@hpplus03.cern.ch>
On Sun, 6 Aug 2000, VTAM_203 wrote:
> sub new {
> my $proto = shift; # allow use as a class or object method
> my $class = ref($proto) || $proto;
> return bless({}, $class);
> }
>
> Can anybody explain to me what the "my $class = ref($proto) || $proto
> statement does"?
perldoc perltoot explains this. Actually, the comment which you have
quoted on the previous line explains this, if you had realised it!
Look for the line
While we're at it, let's make our constructor a bit more flexible.
and read on...
------------------------------
Date: 06 Aug 2000 11:04:35 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: a simple question
Message-Id: <m1bsz6xo3w.fsf@halfdome.holdit.com>
>>>>> "VTAM" == VTAM 203 <VTAM_203@email.msn.com> writes:
VTAM> I have a script for a class from one of my perl books. There's one line in
VTAM> it I don't understand.
VTAM> Here's the script for the constructor of this class:
VTAM> sub new {
VTAM> my $proto = shift; # allow use as a class or object method
VTAM> my $class = ref($proto) || $proto;
VTAM> return bless({}, $class);
VTAM> }
VTAM> Can anybody explain to me what the "my $class = ref($proto) || $proto
VTAM> statement does"?
it makes
my $something_like_x = $x->new;
act like
my $something_like_x = (ref $x)->new;
In other words, copy the class of $x to $something_like_x, without
giving any hint as to whether it's a clone or a copy.
I disagree with this practice. If you want ->clone, write a clone
method (new empty object with same species as previous). If you want
->copy, write that (new object with same *contents* as previous).
$instance->new can be either of those in my mind, so you've just now
overloaded ->new in too many ways. If the goal of the OO interface is
to communicate, then use it, durn it!
Personally, I never have written ->new to be an instance method.
It goes against my grain. In fact, I rarely write ->new. I usually
write something that makes sense within the domain. Like:
my $tv_horse = Horse->named("Mr. Ed");
Only C++ people think that you have to call every constructor "new". :)
print "Just another Perl hacker," # and OO programmer since 1980 smalltalk
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sun, 06 Aug 2000 17:57:49 GMT
From: Oktay <john@torontonian.com>
Subject: Re: can i test cgi scripts on my own pc without a host?
Message-Id: <398DA606.409B38E7@torontonian.com>
Hi!
I am a newbie like you also.
I would strongly recommend you to download IndigoPerl at:
http://www.indigostar.com/indigoperl.htm
It is an apache server with the built in perl.
And the best part is you can add more modules if you feel necessary by
using a built in cgi script that comes with the package.
Best Regards
drdementor@my-deja.com wrote:
>
> I want to test scripts on my own pc without a host. I find it time
> consuming to have to resave scrips online at, well im using hypermart,
> then the site is slow or doesnt work half the time, and im not ready to
> pay for a host yet..
>
> I know that certain things may work different since im on a win98
> machine and im writing the perl for a unix box but im not doing
> anything to cmplicated, im just making a sofisticated string parseing
> program, and would like to save tiles to database too .
>
> I know i might have to have a host online to save files etc, and
> definatly need a host to send emails..
>
> but at least for the parsing just testing out simple form submits to
> test my parsing routines..
>
> can this be done with out needing the scripts online?
>
> when i used to just know html i would prefer writing html in notepad
> and keep a browser open, way faster than havign to upload to a host
> then test...(ya i know writing html by hand is silly anymore with dream
> weaver and what not but i wanted to learn it and have control.)
>
> i downloaded something for perl from perl.com or soemthing, i cant
> remember, i was like cool
>
> but there was no executable and i didnt have a clue how to install it.
>
> can anyone help?
>
> Jim
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sun, 06 Aug 2000 14:36:46 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: convert string from uppercase to lower case
Message-Id: <3991771a.3454087@news.newsguy.com>
newsgroups@ckeith.clara.net (Colin Keith) wrote:
>s/([aeiou])/\u$1/g;
tr/aeiou/AEIOU/;
>Of course, it doesn't account for 'y', but that's left
>as an exercise for the reader:)
Not to mention å, é, ï, õ, û, æ, etc.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: 6 Aug 2000 15:25:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cookie on the server side
Message-Id: <8mjshf$b2t$1@orpheus.gellyfish.com>
On Fri, 4 Aug 2000 23:37:21 +0200 Ed wrote:
> I am looking for a tutorial on how to write and use the cookies on the
> server side (login retrieve and add info etc) or a script that does this so
> I can learn it by examining the data(I have looked at cgi-resources but
> couldn't find it)
>
http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 06 Aug 2000 17:18:08 GMT
From: "Jon Eichelberger" <eichelbe@bellatlantic.net>
Subject: Re: DBI database access problem
Message-Id: <01bbf7ad$55beef80$5c79c597@eichelbe>
You need to use the ALLOCATE DESCRIPTOR command. If you don't have
an Informix SQL Syntax manual, get one. An ESQL/C manual won't hurt,
either. If DBI hides the descriptor name from you, you may need to dig
through
some source code (if you have it).
Jon
Barry Kimelman <bkimelma@midsouth.rr.com> wrote in article
<MPG.13ee81df8bf27762989687@news-server>...
> I am having a problem accessing an Informix database table on my UNIX
> system at the office while using the DBI interface.
>
> The connect succeeds, but the "prepare" statement fails with the
> following error message :
>
> DBD::Informix::db prepare failed: SQL: -479: The number of DESCRIBED
> columns is greater than the allocated space.
>
> According to the perl -v command we are running perl version 5.004_04
> built for RM600-unix.
>
> The table in question has 201 columns. Is there some built in limit with
> respect to the number of columns ? Is there some parameter or
> configuration option which can be used to solve this problem ?
> Please advise as to how to solve this problem.
>
> TIA for all your help.
>
> -----------------------------
>
> Barry Kimelman
> Memphis, TN, USA
> email : bkimelma@midsouth.rr.com
>
------------------------------
Date: Sun, 06 Aug 2000 14:11:49 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Dereferencing correctly in regular expressions
Message-Id: <398f718c.2031726@news.newsguy.com>
marius@bluebrush.com wrote:
>Do this:
>
>$JSP =~ s/<%=\$(\w+)>/@{[ $req->param($1) ]}/g;
>
>or the dumbed down version:
>
>my $tmp=$req->param($1);
>$JSP =~ s/<%=\$(\w+)>/$tmp/g;
What's wrong with
$JSP =~ s/<%=\$(\w+)>/ $req->param($1) /ge;
?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: 6 Aug 2000 15:01:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dreaded 500 message
Message-Id: <8mjr35$69c$1@orpheus.gellyfish.com>
On Sat, 05 Aug 2000 10:26:19 -0400 Kokuryu wrote:
>
> Next time, please read the message that someone posts rather than jump
> to the conclusion that there is something wrong with the code.
>
But you if asked the question here you are implying that you think there
is something wrong with your code, if the code isnt in question then you
should be asking a different group altogether.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 6 Aug 2000 16:40:50 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Dreaded 500 message
Message-Id: <Pine.GHP.4.21.0008061634570.25484-100000@hpplus03.cern.ch>
On Sun, 6 Aug 2000, Kokuryu wrote:
> Excuse me - but this IS the PERL group and the problem IS related to the
> ActivePerl setup and the fact that it DOES NOT WORK WITH THE MS PERSONAL
> WEB SERVER
[poster's determined bid to embarrass himself elided - it's not fair
to kick somebody while they're engaged in a suicide bid...]
> Just making a point.
Masterfully. Clearly you can neither get it to work nor use any help.
Bye.
------------------------------
Date: Sun, 6 Aug 2000 17:38:54 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Editing.cfg file for use with anti-leech Perl script...
Message-Id: <slrn8or8l0.sr6.efflandt@efflandt.xnet.com>
On Sat, 05 Aug 2000 23:59:40 GMT, Cyber Thief <fake@address.com> wrote:
>
>I've got a script that uses the "HTTP REFERER" to verify that user's who
>download files from my site are actually at the site, and not some stolen link.
>The script relies on a .cfg file to know which URLS are permitted to access my
>files. In setting up this file, I was required to put in the URL like this:
>
>http:\/\/internettrash.com\/users\/cyberthief\/
>end
>
>Two lines, right? So, I make this file on Notepad and upload it to the CGI-BIN
>only to find all the info is bunched up together on one line. I run the program
>and it tells me my own site is not permitted to access files! Is there anyway I
>can edit this so the URL and the "end" command show up as separate lines. I
>would also like to add a couple other URLS for access, but I can't because they
>each require their own line, yet the text gets compressed together when I
>upload in ASCII mode. I even tried uploading as binary. No dice. Any
>suggestions?
If you used a regex with something other than slashes (like m||) you would
not have to escape your slashes. What are you looking at this with that
you think it is all run together (I hope not as html)? Maybe there is
something wrong with your Perl code, like forgetting to chomp the input,
or you forgot to hit enter after the last line in Notepad, so Perl never
sees the 'end'.
And I hope you consider that HTTP_REFERER is not a required variable, so
you should only reject it if it is wrong, not if it does not exist.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sun, 06 Aug 2000 10:27:38 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: First Days of Perl (Newbie)
Message-Id: <398D75DA.3402D46E@patriot.net>
> > I downloaded active perl on my windows PC. After I write a line of script,
What is the line of script you are using?
> > and save it as a text file.
What editor are you using?
> How do I view what I have written? According to
> > the book I'm reading
What book are you using?
> it says to save the file with a cgi extension. When I
> > save the file it also adds the .txt at the end is this write? test.cgi.txt
Hhhmmm...sounds like Notepad. Since you are trying to write CGI, one can only
assume that you have a web server that you'll be running this from.
Now, as to your other questions...to open the file as it is now, simply open
Notepad and
tell it to open the file. Or, go to the directory the file is in via the command
prompt, and type:
notepad test.cgi.txt
To write such files in Notepad so that they don't have the .txt extension
automatically appended,
create the file from the command prompt by typing:
notepad test.cgi
To fix what you've got now, go to the command prompt and type:
ren test.cgi.txt test.cgi
------------------------------
Date: Sun, 06 Aug 2000 10:07:32 -0700
From: Diablito <diab.litoNOdiSPAM@usa.net.invalid>
Subject: Re: First Days of Perl (Newbie)
Message-Id: <018b3150.b5980480@usw-ex0103-023.remarq.com>
"David Kocchi" <dkocchi@home.com> wrote:
>I downloaded active perl on my windows PC. After I write a line
of script,
>and save it as a text file. How do I view what I have written?
According to
>the book I'm reading it says to save the file with a cgi
extension. When I
>save the file it also adds the .txt at the end is this write?
test.cgi.txt
>
I guess you are editing the file in notepad.Select the "all
files" while saving the document (otherwise it will add a .txt
extension).Also make sure that the .cgi extension is associated
with perl.exe.
Mario
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 6 Aug 2000 15:50:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Graphic in a search results page
Message-Id: <8mjtvj$fpg$1@orpheus.gellyfish.com>
On Fri, 04 Aug 2000 16:19:14 GMT David wrote:
> Hello, all: I was hoping that someone might have some advice.
>
> The truth is I don't really know Perl at all. I have a search engine on my
> site (www.vangoghgallery.com) and someone else did the coding for me years
> ago. Well, all I want to do is get a graphic to appear at the top of the
> search results page. I include the coding below and I was sure that it would
> work, but it doesn't. No graphic appears. Can anyone let me know what I'm
> doing wrong?
>
Your quoting is all messed up - you have double quotes inside your double
quoted strings. I would recommend that you use a 'here' document for
this :
print <<TUBBIES_SAY_EO;
Content-type text/html
<html>
<head>
<title>Results of Search</title>
</head>
<body>
<div align=center>
<center>
<a href="http//www.barewalls.com/cgi-bin/nph-referral.exe?code=VVGG&path=/cgi-bin/search.exe&searchstring=Vincent+van+Gogh"
onMouseOver="(window.status='Vincent van Gogh'); return true">
<img align=center
src="../images/banners/bw_02.gif"
width="411"
height="66"
border="2"
alt="Barewalls.com - Art Prints and Posters">
</a>
</center>
</div>
<center>
<h1>Results of Search</h1>
</center>
Below are the results of your Search in no particular order
<p>
<hr size=7
width="75%">
<p>
<ul>
TUBBIES_SAY_EO
I have fixed what appears to be an error in the URL as well.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 6 Aug 2000 17:06:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I convert a decimal number to a binary string??
Message-Id: <8mk2er$ucb$1@orpheus.gellyfish.com>
On Fri, 4 Aug 2000 14:33:44 -0700 Larry Rosler wrote:
> In article <8megku$nd8$1@lublin.zrz.tu-berlin.de> on 4 Aug 2000 13:32:14
> -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
>
> ...
>
>> The number is the same, whether you write it 12, or 0x0C, or 1100(2)
>> or even XIII.
>
> Not exactly. :-)
>
> We have this concept of "a baker's dozen", where when you buy twelve
> bagels, say, a thirteenth is thrown in for free. Perhaps that is what
> you meant.
>
And I thought that it was because bakers always made thirteen so they
could have on for themself.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 6 Aug 2000 16:42:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I send data to another Server ???
Message-Id: <8mk11i$poc$1@orpheus.gellyfish.com>
On Fri, 04 Aug 2000 14:42:29 GMT aaron@preation.com wrote:
> In article <8mehlq$nib$1@nnrp1.deja.com>,
> hugo.b@derivs.com wrote:
>> Hi.
>>
>> I need to send some stringvalues to another server for calculation and
>> then receive them back to send it to the HTML Page.
>>
> Is there any way to submit a value, much
> like the question above, but as a HTML form POST to a server through
> PERL.
>
The module LWP::UserAgent will make this possible.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 06 Aug 2000 13:38:33 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: How to show "tail -f" in browser
Message-Id: <tTdj5.76$DT4.2725339@nnrp2.clara.net>
>Matthias Oswald wrote:
>> I was thinking of doing a tail -f on the process log file and show it
>> somehow in another frame of the browser.
>> Maybe someone has an example?
Netscape allows you to use the content type multipart/x-mixed-replace. IE
doesn't (or didn't I dunno about v5) support this. Doesn't HTTP 1.1 support
open connections too? I can't remember. If you want to check this out, dig
out your CGI.pm docs and look for the section labelled "Server Push". It
comes complete with an example. (and a note to look at CGI::Push)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 06 Aug 2000 13:41:25 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: IP spoofing
Message-Id: <9Wdj5.77$DT4.2725732@nnrp2.clara.net>
In article <MPG.13f6ba7b21ac650b989687@news.newsguy.com>, DT <nospam.tom@hotmail.com> wrote:
>Hi,
>
>I want to use "Ip spoofing" to do mass submission to search engines. How
>can I do that.
Oh, I can see a legitimate reason for doing that. Surely if a search engine
has restrictions on what you can submit you should be a good little net
puppy and abide by them. You know just being nice since you want to use
their service ...
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 6 Aug 2000 15:08:15 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Learning Perl, 2nd Ed. Exercises. How can I do them on win98?
Message-Id: <8mjrgf$7kl$1@orpheus.gellyfish.com>
On Sat, 5 Aug 2000 17:17:39 +0100 "Gonçalo" wrote:
> Hello.
> I have bought the book Learning Perl by Oreilly, and it is great.
> But, I have a major problem. At the end of each chapter there are some
> exercises. Well, how can I do them with win98? I did a file called
> exercise.pl and run it on apache trough a string like this
> http://localhost/cgi-bin/exercise.pl but I got the 500 error.
>
You need perl to run Perl programs not a web server.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 06 Aug 2000 17:56:10 GMT
From: Oktay <john@torontonian.com>
Subject: Re: Learning Perl, 2nd Ed. Exercises. How can I do them on win98?
Message-Id: <398DA5A3.67452CAD@torontonian.com>
Hi!
I am a newbie like you also.
I would strongly recommend you to download IndigoPerl at:
http://www.indigostar.com/indigoperl.htm
It is an apache server with the built in perl.
And the best part is you can add more modules if you feel necessary by
using a built in cgi script that comes with the package.
Best Regards
"Gonçalo" wrote:
>
> Hello.
> I have bought the book Learning Perl by Oreilly, and it is great.
> But, I have a major problem. At the end of each chapter there are some
> exercises. Well, how can I do them with win98? I did a file called
> exercise.pl and run it on apache trough a string like this
> http://localhost/cgi-bin/exercise.pl but I got the 500 error.
> Can you help me with this?
> Thanks in advance.
------------------------------
Date: 6 Aug 2000 16:58:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: my what?
Message-Id: <8mk1ua$smc$1@orpheus.gellyfish.com>
On Fri, 04 Aug 2000 13:32:09 GMT amonotod wrote:
> In article <398AB3FD.1A577C1B@ccrs.nrcanDOTgc.ca>,
> Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:
>> john kelly wrote:
>> >
>> > morning :)
>> >
>> > can someone clear this up for me?
>> >
>> > is there a difference btween :
>> >
>> > my $thingy = "isfat"
>> >
>> > and
>> >
>> > $thingy = "isfat"
>> >
>> > - cheers
>> > j
>>
>> Here's the difference:
>>
>> #!/usr/bin/perl -w
>>
>> use strict;
>>
>> my $thingy = "isfat";
>> print "$thingy\n";
>> do_func();
>>
> Here it is declared as a global variable...
>
No it isn't it is declared 'local (lexically) to the enclosing block, file,
or `eval'' as it says in perlfunc.
>> print "$thingy\n";
>>
>> sub do_func()
>> {
>> my $thingy = "isskinny";
>> print "$thingy\n";
>> }
>
> Here it is re-declared as a local variable, effective only in the
> sub-routine.
It is not re-declared, it is a new variable that happens to have the same
name.
> The two variables will not affect one another, but
> remember that when you try to pass the second variable value to another
> routine...
>
Well of course one would generally actually pass the variables as arguments
to the subroutine.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 06 Aug 2000 13:31:02 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Need help fixing a PerlShop problem
Message-Id: <qMdj5.75$DT4.2724744@nnrp2.clara.net>
In article <mfjposcq6qkb4o2oitlut7tvii0pqlqcvi@4ax.com>, Joe
<zipsiteslook@hotmail.com> wrote:
*4th attempt at answering this, and if my newsreader stops
crashing all the time I might actually get to post it* :)
>http://www.fastoil.net/entry.htm
Perlshop is a pile of crap. I dealt with it numerous times in the past
during my days as a support techie. It doesn't use -w, nor -t, nor strict.
It opens files for reading without < and commits no end of CGI sins.
>Now, when a store html page is displayed the page never finishes
>loading. I can see the whole page and place an order. I use IE5 and an
>ISP. The Tech help at Web2010 gets the same result as I do. However,
>AOL users , and maybe others, only get about 40% of the page loaded
>and then it stops.
>It looks like the perl script is trying to load something and can't
>find it.
I don't have a copy of the code that you're looking at, but a version here
(3.2) shows it generating a header via the sub add_company_header(), then
parsing your catalog page for the details, then printing the footer. Once it
has done that it then tries to update a pagehit. Nice idea except that the
output of this script looks like:
Content-Type: text/html
<body text="00000" bgcolor="FFFFFF" link="0000CC" vlink="003366"
alink="FFCC00" background="http://www.fastoil.net/docs/images/none"
><center><font SIZE=-1>[<a
href="http://www.fastoil.net/cgibin/mystore/perlshop.
cgi?ACTION=SEARCH&thispage=menu.htm&ORDER_ID=292949889">SEARCH</a>] [<a
href="http://www.fastoil.net//entry.htm">HOME</a>]
</font></center><br><HTML>
<HEAD>
Yup, its sending a <body> then <HTML><HEAD>. Everything upto the <body> tag
is generated, so I suspect that your catalog page contains something strange
like a <body> tag then <HTML><HEAD> ... ? (Since the code here prints the
header, opens your page and reads until it finds a <body> tag before it
starts printing anything again)
Now right at the end of it is another matter. It prints </BODY></HTML> then
(if left long enough) prints the buttons at the bottom and the logo code. I
suspect that your catalog contains </BODY></HTML> but it doesn't stop before
that. You should check the docs on that, it'll only confuse browsers. The
add_company_footer() func is called, but since it uses buffered printing, I
suspect the program isn't exiting because of the code in a function called
create_log() which looks like:
sub create_log {
my $logfile = shift(@_);
my $TotalLockTime = 0;
### open the logfile for exclusive use, use a lock file as a semaphore,
$locktitle = "$logfile.lock";
while (-e $locktitle) ### check if lock file is in current
Assuming you have the same version, zap the file PageHits.lock but make sure
that your program has write access to this directory to create this file. It
does have a saving grace in that it does have a time out, but I suspect this
isn't working too well.
If you want to try your hand at perl, this would be the first thing to fix.
As the FAQ's say:
"=head2 Why can't I just open(FH, ">file.lock")?
A common bit of code B<NOT TO USE> is this:
sleep(3) while -e "file.lock"; # PLEASE DO NOT USE
open(LCK, "> file.lock"); # THIS BROKEN CODE
"
If that doesn't help at all, try adding $| = 1; to the top of the program
(after the uses') That will turn off the buffering, and you should then see
exactly how far through the program it has gotten by comparing the source
code your browser has received with how far through the lines of 'print' it
has gone.
>My host did make some corrections to a "shell" script that was not
>working properly and was causing a cron job to malfunction. The cron
>job automaticaly emails me the store orders.
If this hasn't been explained. Cron is a program which runs other programs
after certain times. This is why every night at 2:00 am when all good Perl
programmers are in bed dreaming of closures, objects, and other strange
delights, most servers drag themselves awake and start tidying up log files,
processing changes and the like. It has nothing in the slightest to do with
what you're seeing here.
>I've tried running the html pages thru CSEHtmlvalidator4, removing
>changes to the pages I've made, nothing seems to work.
You should check if the web pages need to contain the leading and closing
<HTML> and <BODY> tags, because the output is strange.
Some help I hope.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
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 3928
**************************************