[9822] in Perl-Users-Digest
Perl-Users Digest, Issue: 3415 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 11 07:07:13 1998
Date: Tue, 11 Aug 98 04:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 11 Aug 1998 Volume: 8 Number: 3415
Today's topics:
Re: Access, ODBC and Linux neillunn@ozemail.com.au
ActivePerl 5.005: Dynamically Generated @INC? dave@mag-sol.com
ActivePerl 5.005: Standard Perl Debugger? dave@mag-sol.com
additional info for above question <REPLY_TO_damonbrent@earthlink.net>
Re: calling one script from another script webmaster@schnibitz.hypermart.net
Re: cgi <adam@fastfare.co.uk>
Re: Date and Time huntersean@hotmail.com
dates in excess of 2037 (A Problem???) <tootedom@mlch.ml.com>
Re: dbm help needed <mc@whoever.com>
easy system call <hybrid@twcny.rr.com>
Re: hiding user input (Miguel Cruz)
Re: How to untaint a directory path? (Miguel Cruz)
Re: IMPORTANT: Rules for Posting to USENET (was: Re: va (Tor Iver Wilhelmsen)
Installation problems with Perl5.004 <ben@highway1.com.au>
Re: LOCK DATABASE FILES? <mc@whoever.com>
Perl in DOS or Win95... <johnhurley@erols.com>
Re: problem with exec call in cgi-bin program <mc@whoever.com>
Sending mail using sendmail or Net::SMTP <etmgero@etm.ericsson.se>
Re: Sending mail using sendmail or Net::SMTP <jwb79@mail.idt.net>
Re: Sending mail using sendmail or Net::SMTP <fauvelle@hotmail.com>
Re: Sending mail using sendmail or Net::SMTP (Maurice Aubrey)
Re: Server or Programmer problems? <adam@fastfare.co.uk>
Re: Starting a new script to run in BG (Plamen Petkov)
Re: Starting a new script to run in BG (Maurice Aubrey)
Re: Test Results - Asking a question (Craig Berry)
Re: use strict problem with indirect file variables ? (Phil Taylor)
Re: use strict problem with indirect file variables ? (Phil Taylor)
Re: use strict problem with indirect file variables ? (Phil Taylor)
Re: What is the purpose of Perl (Miguel Cruz)
Re: X-file (?=...), case postponed. (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 11 Aug 1998 06:04:26 GMT
From: neillunn@ozemail.com.au
Subject: Re: Access, ODBC and Linux
Message-Id: <6qomta$3pu$1@nnrp1.dejanews.com>
In article <35cd9a30.3639593@news.tuwien.ac.at>,
Reibenschuh@Interdrive.com wrote:
> On 7 Aug 1998 17:28:21 GMT, scott@softbase.com wrote:
>
> >Stiphane Dupille (sdupille@yahoo.com) wrote:
> >
> >> I try to access Access database on WinNT from a linux
> >> workstation.
> >
> >Isn't going to happen. Access is not a database like Oracle and DB2
> >which can be accessed over a network. Access is a single-machine
> >small-time database not meant for client/server applications. (That
> >doesn't stop people from *thinking* Access is capable of doing more
> >than it does, but anyone who tries to use it for anything other than a
> >mailing list will quickly discover the truth!)
>
Paranoia reigns suppreme yet again. Sure, Access isn't a real database, but
unfortunately a lot of people out there are using it. Mostly because they
really aren;t that comfortable with a real database (kind of scary really!).
In a perfect world - I digress (and so did the previous message).
If you really need to get up and running to an access database. It's going to
get a little complicated.
First off you can go to OpenLink softawre http://www.openlinksw.com where,
there are multi-tier driver setup's available for free evaluation download.
There is a ODBC driver for Access databases (iODBC is bundled) but this has
been aimed at accessing a local file (I think!).
Funny enough Openlink will suport say ODBC to an SQL server on NT by using an
agaent running on NT to control the local access. I don't think that's been
done here, but you can always ask openlink.
Choices: Failing a civilized response from OpenLink, you can always
i.) Replicate the DB on linux.
ii.) Use some commecial NFS package or Samba to get access to the NT volume.
Again, Access isn't a real database, but it tugs my chain when people send
lengthy responses without providing a solution.
Regards,
Neil
mailto:neillunn@ozemail.com.au
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 11 Aug 1998 10:23:30 GMT
From: dave@mag-sol.com
Subject: ActivePerl 5.005: Dynamically Generated @INC?
Message-Id: <6qp631$lj8$1@nnrp1.dejanews.com>
On all of the Unix Perls I've used up to and including 5.004, the value of
@INC is hard-coded into the executable when it's compiled. This means that if
I want I can move the executable and it still refers to the libraries under
the original directory (I know this is a slightly strange thing to want to
do, but bear with me...). Moving perl into different directories and running
'perl -V' gives the same result.
Under ActivePerl 5.005, it seems that the value of @INC is dynamically
generated. It seems to use the directory that the executable is in to
determine what @INC should contain. Moving perl into differnt directories and
running 'perl -V' gives *different* results.
I haven't been able to try this on a Unix version of 5.005 so I suppose it's
possible that this is a 5.005 change rather than an ActivePerl one.
Does anyone have any comments?
Thanks,
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 11 Aug 1998 10:10:46 GMT
From: dave@mag-sol.com
Subject: ActivePerl 5.005: Standard Perl Debugger?
Message-Id: <6qp5b5$kse$1@nnrp1.dejanews.com>
When using ActivePerl 5.005, perl -d script.pl will invoke the ActiveState
Perl debugger. Whilst this is a wonderful GUI debugging environment, for an
old command-line junkie like myself it doesn't really cut it (and besides on
my version the Dump Variable dialog doesn't seem to work).
Is there any way to make ActivePerl go back to the standard Perl debugger?
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 11 Aug 1998 02:17:24 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: additional info for above question
Message-Id: <6qonna$o66$1@birch.prod.itd.earthlink.net>
when i say this code doesn't work, i mean that the while never ends -- the
read never returns 0
EOF isn't seen?
i'm lost.
ok, this is the code ---
binmode(STDIN);binmode(STDOUT);binmode(STDERR);
while($this_much = read STDIN, $buffer, 1024)
{
print $buffer;
}
this code works on the LM and GS ports 5.004_02 (and any UN*X Perl), but the
ActiveState [ 5.003_7(build 316) or 5.005 ] ports will *NOT* run the above
code.
is my code *marginally* proper, or are the ActiveState builds broken?
any ideas of a workaround?
tia,
brent
------------------------------
Date: Tue, 11 Aug 1998 00:18:09 -0700
From: webmaster@schnibitz.hypermart.net
Subject: Re: calling one script from another script
Message-Id: <35CFF031.1F71DC06@schnibitz.hypermart.net>
This is doable, but I can't remember the details just now, but it goes
something like this:
If you want to pass variables from one script to another, and it is in a shell
environment, you would do something like this:
system("./file.pl $variable"),
or die "can't open pipe to fetch: $!\n";
It is pretty late over here, so I am not sure if that is completely correct.
But never the less it is not what you want. You are looking to pass
information from one script to another via HTTP.
<href="http://www.someserver.com/cgi-bin/somescript.pl?variable=$variable">
But that will work if the variable is the same all of the time, the variable
probably has to come from a form right? Okay, I figured out this trick while
observing Altavista.
<form
action="http://www.someserver.com/cgi-bin/somescript.pl?variable=$variable">
Of course "variable" is the value of "value" in HTML forms (was that confusing
or what?). It SHOULD be just a simple HTML dealy. Let us know how it went.
Those suggestions should work.
~Prime
alexkay4510@my-dejanews.com wrote:
> Here is the situation. My order form calls a script on secure server on
> another site. I would like to be able to receive the input form information
> on my site . Call a script on my site and have the info sent by email (
> sendmail ) to me and then call the secure server as it does now to continue
> the process. In other word can one script call another passing the input
> information to both...
>
> Alex
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
------------------------------
Date: Tue, 11 Aug 1998 09:31:49 +0000
From: Adam Ipnarski <adam@fastfare.co.uk>
To: Dean McDonald <dean@connect.com.au>
Subject: Re: cgi
Message-Id: <35D00F85.5A966108@fastfare.co.uk>
Dean McDonald wrote:
>
> hi,
> im learning perl/cgi at the moment and im tryign to write a simply cgi
> interface script that basically is a plain page, with a "username" field..
> and when a username is entered it "fingers" that usename on the local machine.
> Finger just being the unix "finger" command. Below is the code i've written,
> so far.. however it doesnt do _exactly_ what i want. The page seems to load
> up okay, but doesnt execute the finger commmand and/or output the results.
> Could someone maybe have a look, and maybe test it and see where im going
> wrong?. I'd appreciate it..
> if ($username ne 0){
> -[snip]-
> ###########
> sub output{
> open (FINGER,"finger $username|")||die "finger died\n"; while
> (<FINGER>){print;}
> }
>
Your check at the beginning is very dodgy:
if ($username ne 0){...
First of all, 'ne' is a string comparison operator, so it would only
match if $username was equal to ascii value of 0 (the character). (Have
a look at 'man perlop' if you're on a unix machine) You should really be
doing this:
if ($username ne "") { ## String match to check if it is not empty.
Note that you should do a lot of taint-checking on $username, because an
unscrupulous user could use $username to start up other processes by
including a ';'.
Hope this helps.
--adam
Adam Ipnarski
Senior Programmer, Faresearch
adam@fastfare.co.uk | www.travelselect.com
------------------------------
Date: Tue, 11 Aug 1998 10:35:47 GMT
From: huntersean@hotmail.com
Subject: Re: Date and Time
Message-Id: <6qp6q3$mf7$1@nnrp1.dejanews.com>
In article <35CF8547.1BEEE4DF@crocker.com>,
Thomas Emery <temery@crocker.com> wrote:
> How can I show the date as month and day (no year), and the time as just
> hour and minute (dropping the second)?
>
> Tom
You probably want something like this:
my @month = qw(JAN, FEB, MAR, APR, MAY, JUN,
JUL, AUG, SEP, OCT, NOV, DEC);
my ($min, $hour, $mday, $mon) = (gmtime(time))[1..4];
printf("Time %2.2d:%2.2d Date %2.2d/%3.3s",
$min,
$hour,
$mday,
$month[$mon]);
If you want local time instead of UTC substitute the word "gmtime" with
"localtime"
Good luck
Sean H
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 11 Aug 1998 08:53:13 +0200
From: Dominic Tootell <tootedom@mlch.ml.com>
Subject: dates in excess of 2037 (A Problem???)
Message-Id: <35CFEA59.41AB@mlch.ml.com>
Hi everyone... how are you doing??
I have very interesting problem for you. I need to calculate the number
of days between two dates (in perl). OK.. use the localtime function
supplied with the perl standard library to get the number of seconds
since
1 January 1970 for the first date, then the number of second for the
second date. Minus the two and then perform the calculation
(((Remaining
seconds/60)/60)/24). Ok fine that works, but the problem arises when
you
supply a date with the year 2028. The function does not work, The
integer width cannot hold the seconds value, since 2038.
This is quite a problem as I can see a few people using this to
calculate the days between two dates which uses this function, and
there must be quite a few important applications that use this library
which will fail when using a date in excess of 2037.
This is just not a problem limited to perl, perl use the unix epoch date
to get the number of seconds since 1970, so does this then mean quite a
few other applications will have a problem?
An ideal solution to the problem would be:-
Get the number of seconds from 1970 until an end date in 2037, then
specify that end date as the start of the next calculation, so that you
can get the number of seconds since that date
eg. date 1/12/2040.
get the number of seconds since 1/1/1970 for the date 1/12/2037. Then
get the number of seconds since 1/12/2037 to the final date 1/12/2040.
This would be perfect,but is there anyway of specifying this.
This is a very important problem that I need solving. I have kind of a
solution, but it is just a patch.
Please anyone reply to the address below
Yours greatfully
Dominic
*************************************************
Dominic Tootell, Merrill Lynch Derivative Products A.G.
Stauffacherstrasse 5
Zurich 8001.
Switzerland
Email: tootedom@mlch.ml.com
Work Tel:- +41 1 297 7830
Mobile:- +41 079 691 5409
***********************************************
------------------------------
Date: Mon, 10 Aug 1998 14:30:05 +0100
From: Martin C Brown <mc@whoever.com>
Subject: Re: dbm help needed
Message-Id: <35CEF5DD.C5D5EBEE@whoever.com>
foxhound@my-dejanews.com wrote:
> I have a perl program that read and writes to some dbm files on a solaris
> machine.
> The db files are stored with a *.pag and *.dir file format (sdbm?)
Unfortunately, the .pag and .dir don't signify anything except that it's a DBM
file.
Finding out what sort of DBM file it is not always possible without viewing the
original source. Just to make it more complicated, not all DBM implementations
work exactly the same way. In general, accessing a DBM file with SDBM should be
OK, but not the other way around. An SDBM file is not always readable with
GDBM, but GDBM should read DBM and NDBM files OK.
This isn't much help, I know...
> I need to write another program to read and write from the same dbm's, but
> this program must be written in C.
>
> Which header/library do I need to use in C to interface with the perl dbm's?
If it's a standard DBM (ODBM in Perl) database then you need dbm.h, if it's
NDBM you need ndbm.h, if it's SDBM then you'll need to rip out the sdbm library
and header file from the Perl source. If it's GDBM you'll need to download it
and then compile it, then include gdbm.h.
In each case you'll need to use the corresponding library files.
Whichever you use, the basic interface is the same.
View the dbm, ndbm or gdbm man page as appropriate.
MC
------------------------------
Date: Mon, 10 Aug 1998 22:55:06 GMT
From: Kevin & Tharesa <hybrid@twcny.rr.com>
Subject: easy system call
Message-Id: <35CF7AFF.3B1FC0E7@twcny.rr.com>
I've been using perl for unix for a couple of years now, and often do
system calls. They're a piece of cake, and I'm wondering why they
aren't working in my Win32 distribution.
I shouldn't say NOT WORKING. I do something like:
$command = "dir";
system($command);
and it works.... but I get a Invalid switch error, every single time, no
matter what I put in system. And it is the system call... commenting it
out corrects the error message.
I'm sure this is stupid on my part, but this is the first time I've used
perl in windows... I can't believe it's being a pain.
Also, I want to supress error messages (like file not found, on a dir
*.bat > temp or something) but perl -w name.pl doesn't seem to do it.
Any ideas?
Thanks a lot
------------------------------
Date: 11 Aug 1998 07:22:09 GMT
From: mnc@diana.law.yale.edu (Miguel Cruz)
Subject: Re: hiding user input
Message-Id: <6qorf1$alh$1@news.ycc.yale.edu>
In article <6qn5bk$1q7$1@nnrp1.dejanews.com>, <birgitt@my-dejanews.com> wrote:
>So, if the server and the circuits are not public ones, I would
>have thought that the posts too are not public posts.
I don't understand this logic. I can not think of very many (okay, some,
save your fingers) "public" things in the United States which do not depend
entirely or in part on private technology and infrastructure. Does private
contaminate public?
miguel
------------------------------
Date: 11 Aug 1998 07:33:41 GMT
From: mnc@diana.law.yale.edu (Miguel Cruz)
Subject: Re: How to untaint a directory path?
Message-Id: <6qos4l$b4k$1@news.ycc.yale.edu>
In article <6qnu63$v2j$1@nnrp1.dejanews.com>, <kevin@zippy.tnet.com> wrote:
>$directory = shift(@ARGV);
>#need to untaint the directory name given somehow...
Well, the obvious way would be:
$directory =~ /(.*)/;
which would leave an untainted copy in $1.
miguel
------------------------------
Date: Tue, 11 Aug 1998 10:20:23 GMT
From: toriw@online.no (Tor Iver Wilhelmsen)
Subject: Re: IMPORTANT: Rules for Posting to USENET (was: Re: variable inerpolation)
Message-Id: <35da0cdf.10406831@news1.telia.com>
On 11 Aug 1998 02:44:52 GMT, Tom Christiansen <tchrist@mox.perl.com>
uttered:
>--tom, who just neoligismed "clonepost"
*sniff* I miss the old days when they called it "multipost". :-)
PerlFrustration::"That DBI ships with makefiles for dmake and nmake,
and I have GNU make";
--
"I had to upgrade the memory of my 8088 from to 256K to 640K just to play [Demon's Winter]."
- gmadison@usa.net
Tor Iver Wilhelmsen http://www.pvv.org/%7etoriver/
------------------------------
Date: Tue, 11 Aug 1998 16:08:02 +0800
From: Ben Crossman <ben@highway1.com.au>
Subject: Installation problems with Perl5.004
Message-Id: <35CFFBE2.17DE@highway1.com.au>
I'm getting the following installation problem. Any suggestions.
Checking for GNU cc in disguise and/or its version number...
*** WHOA THERE!!! ***
Your C compiler "gcc" doesn't seem to be working!
You'd better start hunting for one and let me know about it.
Exit 1
--
------------------------------------
Ben Crossman
Web Consultant / Maintenance
ben@highway1.com.au
http://users.highway1.com.au/~ben
Highway 1 (Aust) Pty Ltd
------------------------------
Date: Mon, 10 Aug 1998 14:35:57 +0100
From: Martin C Brown <mc@whoever.com>
Subject: Re: LOCK DATABASE FILES?
Message-Id: <35CEF73D.A17EA2C3@whoever.com>
Sleepy_Z wrote:
> I am writing a database file that will only be READ and not WRITTEN to. Do I
> need to lock that database or will it be ok without it?
> I am expecting the database to be accessed appx. 2,000 times a week with a
> burst of 350 an hour.
If you are only reading there shouldn't be any need to lock it. You usually
only lock a database if you are updating the contents and don't want two
processes to update the file at the same time.
------------------------------
Date: Tue, 11 Aug 1998 06:15:37 -0400
From: "John m. Hurley" <johnhurley@erols.com>
Subject: Perl in DOS or Win95...
Message-Id: <35D019C8.7EB76AEA@erols.com>
Hi,
I'm a newbie to PERL programming and I was wondering of there is a way
to test PERL programs on Win95 or DOS. I feel I am getting the idea of
the language but would like to try the in-book programs to learn it
better as well as to privately modify them to "learn from my mistakes".
My server doesn't allow me to use cgi on it's machine so I can't u/l the
files to the server. Any help would be greatly apperciated.
Thanks,
John
------------------------------
Date: Mon, 10 Aug 1998 14:34:47 +0100
From: Martin C Brown <mc@whoever.com>
Subject: Re: problem with exec call in cgi-bin program
Message-Id: <35CEF6F6.DAB74120@whoever.com>
joanna wrote:
> $programToRun = 'perl blabla.pl';
> exec $programToRun;
> ...
> Can anybody tell me why program 1 works fine at command line and does
> not work properly when inserted in a cgi-bin perl program.
You might want to check for errors, although with exec (which replaces the
script you were running and instead runs the new program/script) thats not
always useful.
You could do:
exec $programToRun || die "Can't find $programToRun";
The exec function only returns if the program you are trying to execute
does not exist.
I suspect it's highly likely that the perl program you are calling can't
be found in the path for the exec function, and so your exec appears not
to run at all.
------------------------------
Date: Tue, 11 Aug 1998 08:23:11 +0200
From: Geert Roovers <etmgero@etm.ericsson.se>
Subject: Sending mail using sendmail or Net::SMTP
Message-Id: <35CFE34F.6141CF3F@etm.ericsson.se>
Hi,
In the ActivePerl docs, it says that you don't need an external
mailprogram to send e-mail from within a perlscript. You can use
Net::SMTP instead.
What is better to use? I need to build a script that works on both
Windoze and UNIX. I am developing on Windoze NT4.0 with ActivePerl Perl
5.005 for Win32
~Geert
------------------------------
Date: 11 Aug 1998 06:29:39 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: Sending mail using sendmail or Net::SMTP
Message-Id: <01bdc4f1$90f0bb20$6488fdc7@dixon>
: In the ActivePerl docs, it says that you don't need an external
: mailprogram to send e-mail from within a perlscript. You can use
: Net::SMTP instead.
:
: What is better to use? I need to build a script that works on both
: Windoze and UNIX. I am developing on Windoze NT4.0 with ActivePerl Perl
: 5.005 for Win32
$IMHO = .02;
I'm in a similiar situation (stuck on NT, will move to UNIX for $1.00), and I'm using
the more portable Net::SMTP. I want the evacuation from NT to go quickly,
and without any conversions :-).
Jim
------------------------------
Date: Tue, 11 Aug 1998 11:44:45 +0200
From: Jean-Philippe FAUVELLE <fauvelle@hotmail.com>
To: Geert Roovers <etmgero@etm.ericsson.se>
Subject: Re: Sending mail using sendmail or Net::SMTP
Message-Id: <35D0128D.6B24B25F@hotmail.com>
This works both on Unix and Windows.
use Net::SMTP; # from 'libnet' package
$smtp = Net::SMTP->new('smtp.server.hostname', Timeout=>20);
$smtp->mail($MAIL_FROM, Bits => 8 );
$smtp->recipient($MAIL_TO);
$smtp->data();
$smtp->datasend("To: $MAIL_TO\n");
$smtp->datasend("From: $MAIL_FROM\n");
$smtp->datasend("Subject: $MAIL_SUBJECT\n\n");
$smtp->datasend($MAIL_BODY);
$smtp->dataend();
$smtp->quit;
hope that helps !
_________________________________
Jean-Philippe Fauvelle - Project Manager
fauvelle@hotmail.com
Geert Roovers wrote:
> Hi
> In the ActivePerl docs, it says that you don't need an external
> mailprogram to send e-mail from within a perlscript. You can use
> Net::SMTP instead.
> What is better to use? I need to build a script that works on both
> Windoze and UNIX. I am developing on Windoze NT4.0 with ActivePerl Perl
> 5.005 for Win32
> ~Geert
------------------------------
Date: Tue, 11 Aug 1998 10:07:23 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: Sending mail using sendmail or Net::SMTP
Message-Id: <slrn6t05us.kh2.maurice@we-24-130-48-83.we.mediaone.net>
On Tue, 11 Aug 1998 08:23:11 +0200, Geert Roovers <etmgero@etm.ericsson.se>
wrote:
>Hi,
>
>In the ActivePerl docs, it says that you don't need an external
>mailprogram to send e-mail from within a perlscript. You can use
>Net::SMTP instead.
>
>What is better to use? I need to build a script that works on both
>Windoze and UNIX. I am developing on Windoze NT4.0 with ActivePerl Perl
>5.005 for Win32
Most external mail programs are going to be much more robust, since they
will queue and attempt to resend the message if there are problems.
You may want to do a dejanews search for this topic; a while back,
Zenin argued this point feverishly.
--
Maurice Aubrey <maurice@hevanet.com>
... one of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination
of their C programs.
- Robert Firth
------------------------------
Date: Tue, 11 Aug 1998 09:45:14 +0000
From: Adam Ipnarski <adam@fastfare.co.uk>
To: Cross <mcross@mics.net>
Subject: Re: Server or Programmer problems?
Message-Id: <35D012AA.8BF490D@fastfare.co.uk>
Cross wrote:
>
> I am having problems getting my perl scripts to work. They are very short
> test programs and I have tested them with Active Perl for Win 32 on my
> machine at home but they never work on the server. I have tried everything I
> know (which isn't much).
This is all in the FAQs. Always try looking at
'www.perl.com/perl/faq'. It'll usually help.
See Perlfaq 9 on a UNIX machine, or try one of the following sites
(quoted from perlfaq9):
http://www.perl.com/perl/faq/idiots-guide.html
http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
http://www.perl.com/perl/faq/perl-cgi-faq.html
http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
http://www.boutell.com/faq/
A summary of the most likely problems follows:
a) Perl isn't located at /usr/local/bin/perl. See your ISP for the path
(NB the path should be flush on some machines: #!/usr/local/bin/perl)
b) You aren't putting your script into the cgi-bin (or equiv) directory,
or your ISP doesn't allow executable scripts. See your ISP.
c) Your script doesn't have executable permissions set. Try 'chmod 777
myscript.pl' when you telnet, or 'quote SITE CHMOD 777 myscript.pl'
usually works via ftp. See your ISP if you are not sure.
d) You have an older version of Perl / don't have CGI.pm on the server.
--adam
Adam Ipnarski
Snior Programmer, Faresearch
adam@fastfare.co.uk | www.travelselect.com
------------------------------
Date: Tue, 11 Aug 1998 11:28:05 +0300
From: plamendp@techno-link.com (Plamen Petkov)
Subject: Re: Starting a new script to run in BG
Message-Id: <MPG.103912988bdb1d56989687@news.techno-link.com>
In article <35CE325D.7AA16EE5@xmission.com>
Date: Sun, 09 Aug 1998 17:35:58 -0600
Brandon Pulsipher wrote:
> I am running AS Perl on WinNT 4.0. I am hoping there is solution
> to my dilemma. I would like to have a webpage (Perl Script) load and
> when it does, spawn another process (Perl script, or subroutine) that
> runs in the background until it finishes. Basically, the first time
> each day that a certain script on my site is called up, I want it to run
> a maintenance script. I don't want this to run and have the user wait,
> however, as it could take a while.
I think you shouldn't "spawn" anything. Just display the page (script
does this, doesn't it?) and let the script continue and do their "daily"
job. Don't forget to apply some "locking/loging" logic to prevent more
then one running script(s) to try to do the same job in the same time or
more than once a day.
CGI script just produce an HTML output and continues.
Personaly, I make my clean-up job(s) every time the script is called. For
example, the expired shopping-carts are deleted (if any) at every script
call. I even don't bother if another script instance is making clean-up
at the same time. Let it be! However, this is a true clean-up - i.e. just
deleting. If something is to be logged, modified, etc. the logic would be
much more complicated.
--
=== PLEASE REMOVE ## FROM MY EMAIL ADDRESS! GUESS WHY :-) ===
Plamen Petkov
mailto:plamendp##@techno-link.com
http://bgbook.hypermart.net
------------------------------
Date: Tue, 11 Aug 1998 10:00:38 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: Starting a new script to run in BG
Message-Id: <slrn6t05i7.kgn.maurice@we-24-130-48-83.we.mediaone.net>
On Tue, 11 Aug 1998 11:28:05 +0300, Plamen Petkov <plamendp@techno-link.com>
wrote:
>In article <35CE325D.7AA16EE5@xmission.com>
>Date: Sun, 09 Aug 1998 17:35:58 -0600
>Brandon Pulsipher wrote:
>
>> I am running AS Perl on WinNT 4.0. I am hoping there is solution
>> to my dilemma. I would like to have a webpage (Perl Script) load and
>> when it does, spawn another process (Perl script, or subroutine) that
>> runs in the background until it finishes. Basically, the first time
>> each day that a certain script on my site is called up, I want it to run
>> a maintenance script. I don't want this to run and have the user wait,
>> however, as it could take a while.
>
>I think you shouldn't "spawn" anything. Just display the page (script
>does this, doesn't it?) and let the script continue and do their "daily"
>job. Don't forget to apply some "locking/loging" logic to prevent more
>then one running script(s) to try to do the same job in the same time or
>more than once a day.
>
>CGI script just produce an HTML output and continues.
Make sure you have command buffering turned on. And realize that the
server may kill processes which hang around "too long".
I think spawning is cleaner, if you can do that under NT. See Randal's
column on the subject:
http://www.stonehenge.com/merlyn/WebTechniques/col20.html
>Personaly, I make my clean-up job(s) every time the script is called. For
>example, the expired shopping-carts are deleted (if any) at every script
>call. I even don't bother if another script instance is making clean-up
>at the same time. Let it be! However, this is a true clean-up - i.e. just
>deleting. If something is to be logged, modified, etc. the logic would be
>much more complicated.
cron is simple, and much more efficient.
--
Maurice Aubrey <maurice@hevanet.com>
The first condition for the establishment of perpetual peace is the
general adoption of the principles of laissez-faire capitalism.
- Ludwig von Mises
------------------------------
Date: 11 Aug 1998 06:51:23 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Test Results - Asking a question
Message-Id: <6qoplb$fks$2@marina.cinenet.net>
Jonathan Feinberg (jdf@pobox.com) wrote:
: cberry@cinenet.net (Craig Berry) writes:
:
: > At least until some postulated future time when most people claim to have
: > read the docs, that claim will make a valid pre-filter for good intent.
:
: Hey, everybody! I've read the docs, but they really suck!!! I was
: wondering, how do I...
You know, the gleeful way software people leap directly onto pathological
boundary condtions gets slightly wearing after a while... :)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 11 Aug 1998 06:00:49 GMT
From: phil@ackltd.demon.co.uk (Phil Taylor)
Subject: Re: use strict problem with indirect file variables ?
Message-Id: <35cfdc34.1449029@news.demon.co.uk>
On 11 Aug 1998 02:31:34 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:
Well, thanks for knocking the nail in. My Perl book "teach yourself
Perl 5 in 21 days" from SAMS gives an example of passing file handles
into procedures using the method I posted, so that's why I did it that
way. Obviously know I know better and can do it with one of those
funny snowflake characters.
Apologies for making you Grrrrr, your help is appreciated. I'm not
sure where I'm going wrong, the book says I would have tought myself
Perl by now. I'm well over the 21 days.
Thanks
Phil
------------------------------
Date: Tue, 11 Aug 1998 06:06:32 GMT
From: phil@ackltd.demon.co.uk (Phil Taylor)
Subject: Re: use strict problem with indirect file variables ?
Message-Id: <35cfde18.1933298@news.demon.co.uk>
On 10 Aug 1998 22:06:29 GMT, cberry@cinenet.net (Craig Berry) wrote:
>Phil Taylor (phil@ackltd.demon.co.uk) wrote:
>: I'm trying to do this:-
>:
>: $handle = "MYFILE";
>: open ($handle, "<file1");
>:
>: but it doesn't seem to work when I ' USE STRICT'. Can anyone suggest a
>: way around this problem. I want to use indirect file variables so
>: thatI can use a local procedure to handle my file locking.
>
>Don't use strict if you don't understand it. Use strict requires all
>globals to be declared or explicitly package qualified; as a
>result, most vars under use strict are declared as lexicals
>using my. Presumably, you got that as a warning:
I didn't get the warning.
Your right about 'USE STRICT' , I don't understand it. Well not fully,
but the books recommend you use it to tighten up your code, so I will
carry on using it and let's face it if I hadn't I wouldn't have known
about this issue.
I bet you don't fully understand how your car works, but you still use
it.
> > perl -Mstrict -e '$foo=1'
> Global symbol "foo" requires explicit package name at -e line 1.
> Execution of -e aborted due to compilation errors.
>
>Has your $handle variable been declared? Is it package qualified? Is it
>a lexical?
Yes it was declared.
Thanks
Phil
------------------------------
Date: Tue, 11 Aug 1998 06:08:24 GMT
From: phil@ackltd.demon.co.uk (Phil Taylor)
Subject: Re: use strict problem with indirect file variables ?
Message-Id: <35cfdf76.2282983@news.demon.co.uk>
On Mon, 10 Aug 1998 22:27:39 GMT, sowmaster@juicepigs.com (Bob
Trieger) wrote:
>[ posted and mailed ]
>
>phil@ackltd.demon.co.uk (Phil Taylor) wrote:
>-> I'm trying to do this:-
>->
>-> $handle = "MYFILE";
>-> open ($handle, "<file1");
>->
>->
>-> but it doesn't seem to work when I ' USE STRICT'. Can anyone suggest a
>-> way around this problem. I want to use indirect file variables so
>-> thatI can use a local procedure to handle my file locking.
>
>ahhh?? Did ` my $handle = "MYFILE" ' ever cross your mind?
well I did ...
my ($handle);
$handle = "MYFILE";
>
>and check the return on the open.
>
I'm checking the return, it's irrelavent here.
------------------------------
Date: 11 Aug 1998 07:23:39 GMT
From: mnc@diana.law.yale.edu (Miguel Cruz)
Subject: Re: What is the purpose of Perl
Message-Id: <6qorhr$alm$1@news.ycc.yale.edu>
Randal Schwartz <merlyn@stonehenge.com> wrote:
>Of course, it can only hold on to scalars, arrays, and hashes, but
>that's gonna be about as good as you can get.
Is there really anything else in the universe?
miguel
------------------------------
Date: Mon, 10 Aug 1998 21:41:21 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: X-file (?=...), case postponed.
Message-Id: <1ddkbbw.1wh2xca1tzn3wgN@bay1-160.quincy.ziplink.net>
Patrick Timmins <ptimmins@netserv.unmc.edu> wrote:
> I still don't get why the second element in
> @arr = split /(?=(.*))/s , "Just another Perl Hacker\n" is
> 'ust another Perl Hacker\n' instead of 'Just another Perl Hacker\n' .
> Where is this documented? Don't the "inner parentheses" have priority
> over the outer? To me, it seems more logical if @arr were to equal:
> ('J', 'Just another Perl Hacker\n', 'u', 'ust another Perl Hacker\n', etc).
Because split(//) never matches before the first character in the
string. It only matches *between* actual characters. Because the 'J'
is *before* the match position, it can't be matched by (?=(.*)).
split /(?=(.*))/s
'Just another Perl Hacker\n'
^^
Match between 'J' and 'u'. (?=(.*)) matches 'ust another Perl Hacker\n'
'Just another Perl Hacker\n'
^^
Match between 'u' and 's'. (?=(.*)) matches 'st another Perl Hacker\n'
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3415
**************************************