[12458] in Perl-Users-Digest
Perl-Users Digest, Issue: 6058 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 19 16:07:42 1999
Date: Sat, 19 Jun 99 13:00:25 -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 Sat, 19 Jun 1999 Volume: 8 Number: 6058
Today's topics:
Re: 'use' not working on ISP's NT server <revjack@radix.net>
Re: 'use' not working on ISP's NT server <gellyfish@gellyfish.com>
Re: ******great new site guys!****** <cassell@mail.cor.epa.gov>
Re: ActiveState Perl and use of PPM <gellyfish@gellyfish.com>
Re: Afraid to ask about Y2K! (Paul David Fardy)
Re: changing text in a file? <gellyfish@gellyfish.com>
Re: Command Line Arguments (Tad McClellan)
Re: Command Line Arguments <gellyfish@gellyfish.com>
Re: Creating Datasources? <gellyfish@gellyfish.com>
Re: Cron alternative? <gellyfish@gellyfish.com>
Re: How can I get fork to work (in NT)? <gellyfish@gellyfish.com>
Re: how to change a line of text in a file? <gellyfish@gellyfish.com>
Re: how to read a file reverse (Mark-Jason Dominus)
Re: indexing into a hash <uri@sysarch.com>
Language choice for high-volume Oracle CGI interface? <gregm@well.com>
Re: Language choice for high-volume Oracle CGI interfac (Rene Pijlman)
Re: lexical formatting (util) for Perl? (Tad McClellan)
Re: Losing referrer information when passing through a (Lee)
Re: Module installation question <gellyfish@gellyfish.com>
Re: Neet Perl Obfucation Program (Philip 'Yes, that's my address' Newton)
Re: Parsing bug in Perl? (Bart Lateur)
Re: Parsing bug in Perl? <gellyfish@gellyfish.com>
Re: Perl and artificial intelligence. <cassell@mail.cor.epa.gov>
Perl back to bloody Netscape browser <michael.dean@radiophone-services.co.uk>
Re: Perl back to bloody Netscape browser <rootbeer@redcat.com>
Re: PERL programmer needed for contract job... <gellyfish@gellyfish.com>
Re: Perl und MS Exchange <cassell@mail.cor.epa.gov>
perlcc in Unix (Ryan Ngi)
Re: Relocation error in Socket.so <zmievski@ispi.net>
Re: Relocation error in Socket.so <zmievski@ispi.net>
Re: replacing part of a tab-delimited string <gellyfish@gellyfish.com>
Re: Scalar Names (Tad McClellan)
Re: Scalar Names <gellyfish@gellyfish.com>
Re: simple question about array <gellyfish@gellyfish.com>
Re: simple question about array <rick.delaney@home.com>
Re: Simple question <cassell@mail.cor.epa.gov>
Re: sleeping vs stopping and restarting (Gregory Snow)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Jun 1999 17:37:08 GMT
From: Chomsky Hegelian <revjack@radix.net>
Subject: Re: 'use' not working on ISP's NT server
Message-Id: <7kgkg4$94c$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Jonathan Stowe explains it all:
:On Fri, 18 Jun 1999 09:21:30 +0100 Dave Cross wrote:
:>
:> It's them. strict.pm has been a standard part of Perl for some
:> considerable time. If it's not in the @INC path then someone has
:> massively screwed up your Perl installation.
:>
:In another thread someone describes a situation where the single
:directory pointed to by @INC was found to be empty on inspection -
:a massively screwed up installation I would say.
Perhaps they simply put a copy of the perl executable in /usr/bin (or the
NT equivalent), and considered that an installation? Would that even
*work*? I have no idea.
------------------------------
Date: 19 Jun 1999 19:39:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: 'use' not working on ISP's NT server
Message-Id: <7kgrmf$48g$1@gellyfish.btinternet.com>
On 19 Jun 1999 17:37:08 GMT Chomsky Hegelian wrote:
> Jonathan Stowe explains it all:
> :On Fri, 18 Jun 1999 09:21:30 +0100 Dave Cross wrote:
> :>
> :> It's them. strict.pm has been a standard part of Perl for some
> :> considerable time. If it's not in the @INC path then someone has
> :> massively screwed up your Perl installation.
> :>
>
> :In another thread someone describes a situation where the single
> :directory pointed to by @INC was found to be empty on inspection -
> :a massively screwed up installation I would say.
>
> Perhaps they simply put a copy of the perl executable in /usr/bin (or the
> NT equivalent), and considered that an installation? Would that even
> *work*? I have no idea.
>
Err, it will run and compile scripts sure ;-{ . The problem arises when
an ISP will cause their customers programs to be run in a chroot
environment - the administrator will then possibly only copy the perl
binary and not much else into whatever will be the /usr/bin for that
environment. Of course the only proper way to do it is to build perl
from scratch in that environment (this will show up any missing dependencies).
It can be fixed in some cases with a judicious use of cpio -pdcum over
the 'real' /usr/lib/perl5 of course but then there may be missing libraries
and all sorts of other stuff. Hey I work for an ISP and I had to fix
up my own web space ... (but its easy when you know the root password for
the server isnt it :).
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 12:50:10 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: ******great new site guys!******
Message-Id: <376BF472.2528AD0B@mail.cor.epa.gov>
IlIIIIIIII wrote:
>
> check out:
> http://devlib.cjb.net
Perfect.. if you think the only thing Perl is for is CGI. They
don't have Perl as a separate category. No, it's "Perl/CGI" only.
so then I look at their forums, and what do I see at the bottom
of the page? This:
"Scripts and WWWBoard created by Matt Wright and can be found at Matt's
Script
Archive "
The bad spacing is part of the page. And they actually are proud
to be using some of Matt Wright's kludges! <shudder>
In the immortal words of Stan Lee, "nuff said."
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 19 Jun 1999 19:12:00 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ActiveState Perl and use of PPM
Message-Id: <7kgq20$486$1@gellyfish.btinternet.com>
On Sat, 19 Jun 1999 15:10:49 GMT Erol Bernstein wrote:
> Hello yours,
>
> I installed ActivePerl and was enjoyed about the fine documentation.
> But I have a problem, before installation of ActiveState-Perl, I could
> use the Tk-package, because it was in @INC-path.
>
> Now, a new @INC-path is set by Active-Perl.
>
> In the directory c:\perl\lib\site, I have Tk.pm and a subdir called
> Tk, furthermore a GD.pm, which I want to use.
>
> Now, I tried to install these packages with 'ppm'-manager.
>
> PPM>install /location c:\perl\lib\site Tk.pm
>
> gives:
>
> Error installing package 'Tk.pm': Could not locate a PPD file for
> package Tk.pm
>
> What's a PPD-file?
>
A Perl Package Description (I believe) - you wont be able to simply
do what you are attempting as the stuff in your original installation
is not a valid Package - you might want to do:
C:\> ppm install Tk
Of course you will have to be connected to the 'net for that to work.
The documentation that comes with the activestate distribution explains
how PPM works.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Jun 1999 18:17:51 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7kgmsf$5sf$1@coranto.ucs.mun.ca>
Lee <rlb@intrinsix.ca> wrote:
>>> In Perl, I *expect* to find the imaginary humantime() function. This
>>> is one of the few times it has left me disappointed.
Lee <rlb@intrinsix.ca> later wrote:
>> I know (or suspect, I've never actually used any of them) that
>> there are at least three modules that give this functionality. But
>> it seems such a common need/desire that it shouldn't require a
>> module. Or am I being a silly git again?
abigail@delanet.com (Abigail) writes:
> What's the fear for a module?
If it's in Perl's core modules, no fear. Elsewise, the trouble I have
is with portability. I'll have to distribute a growing list of modules
with my programs. And is the module up-to-date?
Paul Fardy
------------------------------
Date: 19 Jun 1999 18:24:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: changing text in a file?
Message-Id: <7kgn8h$437$1@gellyfish.btinternet.com>
On Fri, 18 Jun 1999 00:01:24 GMT outlaw_torn wrote:
>
> open (MYFILE, ">$myfile");
> print MYFILE $file;
> close (MYFILE);
>
> This overwrites the file with $file (which should hold the entire
> content of the file anyway + your substitutions). It works similar to
> your idea of writing to a temporary file and the replacing the original
> file, but instead of a temporary file, you use a temporary variable.
>
> You might want to add some tests in there as well...like open (...) or
> warn "Can't open file", etc. But thats up to you.
>
That is possibly the worst piece of advice I have witnessed in this
newsgroup for a long time - let me illustrate :
gellyfish@gellyfish:/home/gellyfish/clpmtest > >testfile
gellyfish@gellyfish:/home/gellyfish/clpmtest > chmod 444 testfile
gellyfish@gellyfish:/home/gellyfish/clpmtest > testfile.pl
print on closed filehandle main::FILE at ././testfile.pl line 4.
gellyfish@gellyfish:/home/gellyfish/clpmtest >
Where testfile.pl is :
#!/usr/bin/perl -w
open(FILE,">testfile");
print FILE "Blah blah";
close(FILE);
Of course if one had omitted the -w then there would have been no diagnostic
message - we would next see a post "Writing to a file doesnt work - is this
a bug ?", the print having silently failed to work.
However even without the -w but with an appropriate check on the success
of the open :
#!/usr/bin/perl
open(FILE,">testfile") || die "Cant open file for writing - $!\n";
print FILE "Blah blah";
close(FILE);
We get a useful diagnostic :
Cant open file for writing - Permission denied
You now know why the open didnt work and you have avoided writing to
an invalid filehandle.
Using warn() isnt sufficient if an open has failed: you need to alter the
order of execution in same way to avoid using the invalid filehandle.
Perl on Unix is fairly tolerant of this - it is relegated to a warning.
However on other platforms and with other languages it may well be fatal.
Of course it is not appropriate to simply die() in all cases - in ,
for instance, a programme written for the CGI one might want to alter
the flow of control in some other way in order that you dont present
your user with a confusing message and possibly allow some recovery :
if ( open(FILE,">testfile"))
{
# do whatever it is that you wanted to do ...
}
else
{
# Print a helpful message or do something else useful ...
}
To simply ignore some failure condition in a program - *in any language* -
is bad programming practice; if the description of some function in perlfunc
mentions that it will return a false value on failure then that should
be checked and acted upon appropriately. This should *not be considered
to be an option*. Good programmers always do this; bad programmers will
get found out sooner or later.
Please dont dispense bad advice.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 07:09:14 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Command Line Arguments
Message-Id: <qotfk7.dln.ln@magna.metronet.com>
Edmund Paddington (edmundp@bigfoot.com) wrote:
: This may not at first look like a suitable posting for this newsgroup,
It is not suitable for posting to this newsgroup as it is
clearly answered in the docs that came with perl and easily
found!
: but
: it does concern perl and having spent all day reading FAQ's and manuals
: without coming up with an answer, I hope someone can help me.
Golly, you must have missed the most obvious thing to try then.
: Subject: Command Line Arguments
^^^^^^^^^^^^^^^^^^^^^^
grep -i 'Command Line Arguments' *.pod
Finds 2 lines. One of them says:
perlvar.pod:The array @ARGV contains the command line arguments intended for the
<sound of palm smacking forehead>
: In either case, how do I assign the values to my variables.
my $first = $ARGV[0];
my $second = $ARGV[1];
my $third = $ARGV[2];
or
my($first, $second, $third) = @ARGV;
or
my $first = shift;
my $second = shift;
my $third = shift;
: I'm tearing my hair out with this, I hope someone can help.
I hope you feel silly.
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Jun 1999 15:24:24 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Command Line Arguments
Message-Id: <7kgcn8$3u6$1@gellyfish.btinternet.com>
On Sat, 19 Jun 1999 15:39:32 +0100 Edmund Paddington wrote:
>
> Someone has supplied me with a program (not written in Perl - it is in C I
> believe). They've told me that the program will call my script from the
> command line with a line such as
>
> 'call1.pl conf 24 399'
>
> where call1.pl is the name of my script and the arguments conf, 24 and 399
> are results from the program which would need to be assigned to scalar
> variables within my script.
>
Thats fine - you will need to read about @ARGV in the Perl documentation.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Jun 1999 15:46:19 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Creating Datasources?
Message-Id: <7kge0b$3vd$1@gellyfish.btinternet.com>
On Thu, 17 Jun 1999 16:25:31 -0300 Kevin Howe wrote:
> Does anyone know of a module that allows creation of ODBC datasource names
> from a web browser (UNIX or NT)?
>
You may well want to use the module Win32::Registry to create the necessary
entries in the Registry directly.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Jun 1999 15:34:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cron alternative?
Message-Id: <7kgd9g$3v6$1@gellyfish.btinternet.com>
On Sat, 19 Jun 1999 08:21:20 -0500 RLD wrote:
>>If you can't use cron, use at. :-)
>
> Thanks... I've spent a good deal of time this morning trying to look
> something up on "at" and you can imagine what searches bring up with that
> word :-) Is there a clear explanation of this function?
>
It is not a function it is a Unix command.
You probably want to look for some manpage server on the net - I think
also that they have the full set of manpages at :
<http://www.freebsd.org/docs/>
But you might find some other location too..
>>You're right. None of this is Perl-specific. Maybe you should check the
>>docs, FAQs, and newsgroups about programming for the CGI environment.
>
>
> Will do... however... can you give me an example of how you would pass the
> command to cron/at from the Perl script? Where can I find this information?
>
Once you have read the documentation this will become clear to you -
the simplest you could do with at would be :
#!/usr/bin/perl -w
use strict;
open(AT,'|/usr/bin/at 16:30') || die "Cant fork - $!\n";
print AT "somecommand\n";
close(AT) || die "Problem with at - $?";
You might want to lose the output from the command somehow - but that is
discussed in the FAQs that you have read,
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Jun 1999 18:42:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How can I get fork to work (in NT)?
Message-Id: <7kgoa1$47t$1@gellyfish.btinternet.com>
On Thu, 17 Jun 1999 09:47:47 -0700 David Cassell wrote:
> [1] voodoo using a picture of Bill Gates
> [2] install cygwin32 and build perl on that, but it's sloooooow
And Mr Feinberg will stick pins in your effigy - believe me I've been
there ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Jun 1999 19:47:14 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to change a line of text in a file?
Message-Id: <7kgs42$48j$1@gellyfish.btinternet.com>
On Thu, 17 Jun 1999 14:32:09 -0700 Ariel wrote:
>
> $myfile = "example.txt";
> open(MYFILE, $myfile);
ALWAYS test whether a function that requires the use of some
external resource to your program has worked or not. The file may be
nonexistent, you may not have permission to read it or on some systems
it may be opened by a process that has gained its exclusive use.
If you do not do this then any further operation that you perform on
the filehandle will fail - If you have been sensible enough to use the -w
flag to perl then you will be warned about what you have done, if you
havent (and why not) it will fail silently and you will be no wiser as
to what has gone wrong.
open(MYFILE,$myfile) || die "cant open $myfile - $!\n";
> while (<MYFILE>) { #check each line
> #use pattern matching to check each line ($_) against a pattern, and if so
> replace it with something else
> close(MYFILE);
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 16:08:50 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: how to read a file reverse
Message-Id: <7kgf9j$adp$1@monet.op.net>
In article <Pine.GSO.4.02A.9906190846380.25127-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
>Say you know that no line is ever longer than 100 characters, a reasonable
>assumption. Use seek() to move to 100 * (14 + 1) = 1500 characters before
>eof, then use code like this.
>
> <FILE>; # skip (possibly) partial line
> my @lines = <FILE>; # grab last lines
> splice @lines, 0, @lines-14; # keep only last 14
> # Optional safety check
> die "Oops, didn't find 14 lines" unless @lines == 14;
We can embellish this a little to make it more robust:
$LINE_LENGTH = 80;
while (@lines < 14) {
seek FILE, -($LINE_LENGTH * 14), 2;
<FILE>;
@lines = <FILE>;
$LINE_LENGTH *= 2;
}
splice @lines, 0, @lines-14;
It starts off by looking at the last 1120 bytes of the file. If the
last 14 lines don't fit into that segment, it doubles the size of the
segment to 2240 and looks in the larger segment; it keeps doing that
until the segment includes the last 14 lines, no matter how long they
are.
If you expect long lines, initialize $LINE_LENGTH to a reasonable estimate.
------------------------------
Date: 19 Jun 1999 12:59:16 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: indexing into a hash
Message-Id: <x7vhck9lej.fsf@home.sysarch.com>
>>>>> "MD" == Mark-Jason Dominus <mjd@op.net> writes:
MD> In article <x7909qhvhn.fsf@home.sysarch.com>,
MD> Uri Guttman <uri@sysarch.com> wrote:
>> and how do you delete entries by key?
>>
>> As a better solution, perl 5.005 has experimental support for
>> pseudo-hashes which would allow for this.
MD> Perlref:
MD> Perl will raise an exception if you try to delete keys
MD> from a pseudo-hash ... .
not only is the feature experimental, my knowledge of it is too.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sat, 19 Jun 1999 09:09:03 -0700
From: Greg McCann <gregm@well.com>
Subject: Language choice for high-volume Oracle CGI interface?
Message-Id: <376BC09F.3BDF0004@well.com>
We're doing a proposal for a system doing high-volume financial transactions on
the internet. We're expecting 10,000 transactions per day at the beginning, up
to 1,000,000 transactions per day eventually. The client has specified an
Oracle database with an NT web server, using SSL for secure communications both
between the browser client and our server and between remote servers and our
main server.
We're debating what language to use for the CGI programming. C++, Java, Perl,
...? I have some experience using Perl for database access, but not with Oracle
or on a system as large as this. Do you have any thoughts on the relative
merits of these languages for this application? If possible, we would like to
follow a path which wouldn't lock us in to a Microsoft platform.
Thanks,
Greg
------------------------------
Date: Sat, 19 Jun 1999 16:33:21 GMT
From: R.Pijlman@applinet.nl (Rene Pijlman)
Subject: Re: Language choice for high-volume Oracle CGI interface?
Message-Id: <376bc441.31028827@news.xs4all.nl>
Greg McCann <gregm@well.com> wrote:
>We're doing a proposal for a system doing high-volume financial transactions on
>the internet. We're expecting 10,000 transactions per day at the beginning, up
>to 1,000,000 transactions per day eventually. The client has specified an
>Oracle database with an NT web server, using SSL for secure communications both
>between the browser client and our server and between remote servers and our
>main server.
>
>We're debating what language to use for the CGI programming.
Don't use CGI for high-volume transactions. It spawns a process with a new
database session for every hit. Use Oracle Application Server instead. A good
programming language would be PL/SQL or Java (Oracle 8i). This solution would
be Oracle-dependent, but Microsoft-independent.
Register for technet and browse:
http://technet.oracle.com/product/appsvrs/oraapp/main.htm
http://technet.oracle.com/product/appsvrs/oraapp/info2/oas40wp.pdf
Vriendelijke groet,
--
Rene Pijlman <R.Pijlman@applinet.nl>
http://www.applinet.nl/ Informatiesystemen & Internet
------------------------------
Date: Sat, 19 Jun 1999 09:06:10 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: lexical formatting (util) for Perl?
Message-Id: <2k4gk7.44o.ln@magna.metronet.com>
Michael Nordberg (michael@nordberg_remove_.net) wrote:
: Aside from getting fancy with regexps, what would be among the easiest
: ways to reformat some very poorly formatted (in terms of lexical
: style) perl? Is there something for perl that would be the eq' of the
: unix formtatting util "indent"?
Perl FAQ, part 3:
"Is there a pretty-printer (formatter) for Perl?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 19 Jun 1999 14:07:43 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: Losing referrer information when passing through a perl script...?
Message-Id: <B39154AF966841F43B@204.112.166.88>
In article <7ke9tr$qac$1@news3.Belgium.EU.net>,
"Euro Jake" <jde222RemovethiS@iname.com> wrote:
>And the referrer is still valid before the redirect happens...
>If the password isnt valid, the redirection instructions are left out
>displaying the error page... where the referrer info is still present
>
>Im aware the prob isnt sitting in the Perl interface itself... but more in
>the transactions between the documents... and/or the interaction
>HTML/Perl/Javascript
No, it's between the browser and the server. The browser can tell the
server whatever it pleases, which may be nothing.
What do you think the referrer *should* be after redirection? I've seen no
referrer (as have you), the script that did the redirection, and the page
that called the script that did the redirection. All make sense, in a way,
but if you want any one of those consistently after the redirection, you're
going to have to store it and retrieve it yourself.
Lee
------------------------------
Date: 19 Jun 1999 15:36:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Module installation question
Message-Id: <7kgdek$3va$1@gellyfish.btinternet.com>
On Wed, 16 Jun 1999 16:04:37 -0500 Christopher Cavnor wrote:
>
> a directory for the files. This puts the *.pm file in a subdirectory of
> the rest of the *.pm files. If I call a particular module through a
> perl app (use *.pm), how is it going to find these? Should I move just
> the *.pm file to the same level as all of the other Perl mods? Can I
> trash everything else (the makefiles, c source files, etc)?
>
Have you read what it says in the README file in the directory which
was created when you unpacked your archive file.
This will answer your question.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 04:45:35 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: Neet Perl Obfucation Program
Message-Id: <376ab822.55254904@news.nikoma.de>
On Fri, 18 Jun 1999 20:07:40 GMT, nospam.newton@gmx.net (Philip 'Yes,
that's my address' Newton) wrote:
>My hope was that programs that filter out addresses would throw out
>the signal word, thus producing an undeliverable e-mail address and
>sparing me some spam.
It doesn't really work, but what does? Or perhaps I just got two spam
messages from stupid address-harvesters (who don't check for 'nospam'
addresses) and the "smart" address-harvesters' messages didn't get to
me... no way to tell. Total tally so far: two messages.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: Sat, 19 Jun 1999 16:54:14 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Parsing bug in Perl?
Message-Id: <376bcaee.481197@news.skynet.be>
Tom Phoenix wrote:
>Is it because me's reply dates from 2 AM local time. Jesus that you came
>to see me today? Please go on.
I can't make head not tail of this sentence.
But anyway, THIS reply was posted at 8:30 AM. So WHEN do you sleep?
Bart.
------------------------------
Date: 19 Jun 1999 15:25:51 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Parsing bug in Perl?
Message-Id: <7kgcpv$3u9$1@gellyfish.btinternet.com>
On Sat, 19 Jun 1999 13:18:17 GMT Bart Lateur wrote:
> Daniel Grisinger wrote:
>
>>It's 7 am locally, which, so far as I am concerned, is in no way
>>a `natural' time for a human to be doing anything besides sleeping. :-)
>
> On a saturday? Damn right!
>
I would guess sunday morning is about my most productive time ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 12:30:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl and artificial intelligence.
Message-Id: <376BEFC6.CE758C84@mail.cor.epa.gov>
Abigail wrote:
> ktb (xyf@inetnebr.com) wrote on MMCXVIII September MCMXCIII in
> <URL:news:376AFCA9.A4EE3ECD@inetnebr.com>:
> @@ Hi, I've been searching for something on the net about artificial
> @@ intelligence using the Perl language. Most of the programs seem to be
> @@ [snip]
>
> Didn't AI die in the mid-80's, even before Perl 1 was born?
Nope, just the really big HAL-in-four-years claims. Now it
seems that any AI research useful enough to be put into apps
is immeidately branded 'not-AI' by the AI masters.
> Anyway, if you are new to programming, I wouldn't try AI. That's like
> driving a formula 1 bolide while new to driving.
If it's so artificial, then why does it keep asking us how
to use a variable name to call another variable name?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sat, 19 Jun 1999 17:56:52 +0100
From: "Michael Dean" <michael.dean@radiophone-services.co.uk>
Subject: Perl back to bloody Netscape browser
Message-Id: <7kgi05$gp5$1@uranium.btinternet.com>
Hi
Can anyone please help ?
My perl scripts work fine with Internet Explorer V4+
However they do not work with Netscape (I'm using V4.5)
Basically when I exit a perl script & display a web page -
ie a plain page
print start_html();
print end_html();
With i.e.5 I get a plain page. With Netscape I get a new page showing
<html>
<head>
</head>
<body>
</BODY></HTML>
I'm using CGI.pm (:all) selected
Thanks - Michael
------------------------------
Date: Sat, 19 Jun 1999 10:34:51 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl back to bloody Netscape browser
Message-Id: <Pine.GSO.4.02A.9906191034270.25127-100000@user2.teleport.com>
On Sat, 19 Jun 1999, Michael Dean wrote:
> My perl scripts work fine with Internet Explorer V4+
> However they do not work with Netscape (I'm using V4.5)
If you're following the proper protocol but some browser or server doesn't
cooperate, then it's the other program's fault. If you're not following
the protocol, then it's your fault. If you aren't sure about the protocol,
you should read the protocol specification. If you've read it and you're
still not sure, you should ask in a newsgroup about the protocol.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 19 Jun 1999 15:49:33 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PERL programmer needed for contract job...
Message-Id: <7kge6d$3vh$1@gellyfish.btinternet.com>
On Fri, 18 Jun 1999 08:38:41 -0400 brian d foy wrote:
>
> you forgot to rewrite wwwboard. ;)
>
I just couldnt do it -
vi^H^Hvi^H^Hvi^H^Hrm wwwboard.pl
Aaaah thats better ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 11:55:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: dpotocnik <dpotocnik@access.ch>
Subject: Re: Perl und MS Exchange
Message-Id: <376BE7A7.B360D126@mail.cor.epa.gov>
[courtesy cc sent to poster]
dpotocnik wrote:
>
> Sehr geehrte Perl Enthusiasten
>
> In meiner Firma mvchte ich sehr gerne meinen Chef
> von Perl |berzeugen. Da er der Meinung ist, dass Perl in einem Unternehmen
> gar keine Verbreitung findet, m|sste ich Ihn vom Gegenteil beindrucken.
> In Zukunft kriegen wir ndmlich einen MS Exchange Server ins Hause, und ich
> denke mir, dass sich mit Perl diesbez|glich sicher was machen ldsst (da ja
> Perl die Nr.1 f|rs Internet ist).
> Meine Frage:
> Kann MS Exchange Server als POP3 Server fungieren ? Hat jemand unter euch
> schon Erfahrungen in diesem Sinne gesammelt ?
>
> Was ich noch erwdhnen muss ist, dass ich noch fast kein Know - How in Sachen
> Perl besitze.
I noticed that no one had answered your post, so I thought I
would take a stab at it, even though there are others in this
group whose German is better, and who are more knowledgeable
about MS Exchange Server.
I don't think that MS ES will run as a POP3 server. I think
it is designed to use MAPI. But there is a Win32::OLE module
which works with ActiveState Perl (www.activestate.com),
and there is a MAPI module written for win32 as well. I
don't know off-hand where the MAPI module is (it's not in
the ActiveState PPM repository), but I have not checked
the other PPM repositories referenced in the ActivePerl
documentation for PPM (they list four additional ones).
I hope this helps,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sat, 19 Jun 1999 18:05:15 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: perlcc in Unix
Message-Id: <376bdb3b.10265145@news.inet.co.th>
I found perlcc in Win32 but didn't find it in my Linux,
is it available?
if not, is there any command to translate perl script to c source
file????
------------------------------
Date: Sat, 19 Jun 1999 15:35:08 GMT
From: Andrey Zmievski <zmievski@ispi.net>
Subject: Re: Relocation error in Socket.so
Message-Id: <7kgdbc$sss$1@nnrp1.deja.com>
In article
<Pine.GSO.4.02A.9906181541480.5420-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
>
> Your Socket module seems to be mis-installed. (Ask your admin to) be
sure
> that 'make test' works before doing 'make install' for Perl, which
should
> fix things. Cheers!
Socket module is fine. 'make test' passes all tests. Seems like some
sort of problem with with loading inet_ntoa from libsocket.so or
libnsl.so. I have no idea why that might be happening. Anyone see
anything similar before?
-Andrey
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 19 Jun 1999 16:15:12 GMT
From: Andrey Zmievski <zmievski@ispi.net>
Subject: Re: Relocation error in Socket.so
Message-Id: <7kgfma$thd$1@nnrp1.deja.com>
In article
<Pine.GSO.4.02A.9906181541480.5420-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> Your Socket module seems to be mis-installed. (Ask your admin to) be
sure
> that 'make test' works before doing 'make install' for Perl, which
should
> fix things. Cheers!
I figured out why all tests passed. The test file for socket is trying
to connect to port 7 which is disabled on my machine, so inet_ntoa never
gets called. I changed the port to another one, and now it connects and
once it gets to calling inet_ntoa I get:
lib/socket.........ld.so.1: ./perl: fatal: relocation error: file
../lib/auto/Socket/Socket.so: symbol __inet_ntoa: referenced symbol not
found
Why wouldn't it be able to find that symbol in libsocket.so or
libnsl.so?
-Andrey
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 19 Jun 1999 19:16:41 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: replacing part of a tab-delimited string
Message-Id: <7kgqap$489$1@gellyfish.btinternet.com>
On Sat, 19 Jun 1999 14:58:56 GMT JQ wrote:
> Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>>In comp.lang.perl.misc,
>> pigs_can_fly@mindless.com (JQ) writes:
>>:I have a tab-delimited string:
>>:$string = "one two three four";
>>
>>That's not tab-delimited. That's not even whitespace-delimited.
>>Do you know what delimited means?
>>
>
> Pardon my English.
>
> I have a string:
> $string = "one two three four";
>
> with [tab] characters between "one", "two", "three", and "four".
>
>
Thats tab *separated* then for future reference.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 07:21:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Scalar Names
Message-Id: <8gufk7.dln.ln@magna.metronet.com>
Abigail (abigail@delanet.com) wrote:
: What good is a decent group if you don't read it?
It is just comforting to know that it is there for whenever
you need the answer to a Frequently Asked Question, but
are too lazy or stupid to check the FAQs that are
installed on your hard disk.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Jun 1999 19:23:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Scalar Names
Message-Id: <7kgqnd$48d$1@gellyfish.btinternet.com>
On Sat, 19 Jun 1999 01:15:03 +0100 Troy Knight wrote:
> At last I've found a decent perl newsgroups, been searching for one for
> ages!
If you persist in your desire to use symbolic references then this might
not be the newsgroup for you - if however you alter the design of your
program so that it will use a hash or an array instead then yes this
is a 'decent perl newsgroup' (BTW that should be Perl - we talk more
about the language rather than the program).
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Jun 1999 18:55:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: simple question about array
Message-Id: <7kgp30$481$1@gellyfish.btinternet.com>
On Wed, 16 Jun 1999 21:24:49 -0400 sydney qiu wrote:
> Hi, I am a beginner of perl and basiclly teaching myself from the book
> Learning Perl. In chapter there is an example @array=(1.3 .. 6.1) is
> equal to (1.3, 2.3, 3.3,4.3, 5.3)
> however I tried this out on my system and I got (1,2,3,4,5,6)
> Can anyone tell me what is happenning here?
I dont believe that 'Learning Perl' says that the range operator work
on anything but integers - of course I might be wrong in that. Nonetheless
the range operator dont work on anything but integers.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 19 Jun 1999 19:44:20 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: simple question about array
Message-Id: <376BF2D5.BC9E04CA@home.com>
[posted & mailed]
Jonathan Stowe wrote:
>
> I dont believe that 'Learning Perl' says that the range operator work
> on anything but integers - of course I might be wrong in that. Nonetheless
> the range operator dont work on anything but integers.
Of course, _Learning Perl_ and Jonathan are not always right. When in
doubt, consult the docs that come with perl. From perlop:
The range operator (in list context) makes use of the magical
auto-increment algorithm if the operands are strings. You
can say
@alphabet = ('A' .. 'Z');
to get all the letters of the alphabet, or
$hexdigit = (0 .. 9, 'a' .. 'f')[$num & 15];
to get a hexadecimal digit, or
@z2 = ('01' .. '31'); print $z2[$mday];
to get dates with leading zeros.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sat, 19 Jun 1999 12:37:08 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Simple question
Message-Id: <376BF164.492FC175@mail.cor.epa.gov>
Taswar Bhatti wrote:
>
> I have a little problem in my cgi script.
The problem may not be in your code.
> All I want to do is get the user domain name. When
> I use $ENV{'REMOTE_HOST'} what it returns to me
> is a NULL string but I could get the IP address
> of the user from $ENV{'REMOTE_ADDR'}.
> What I really want is not their IP but
> their domain name like www.yourdomain.com or
> even the machine they are on like proxy2.rdc1.ab.wave.home.com
> Could someone tell me what I am doing incorrect or do I have
> to use nslookup to find out their domain name.
> Could it also be that there is some kind of
> server configuration that is not allowing me to get their
> domain name from REMOTE_HOST???
Bingo. What headers you can grab is a function of the
server and the server's configuration. It looks like you're
aware that you could be seeing a proxy, or even a spoofed
address.
> Source code.
>
> #!/usr/local/bin/perl
#!/usr/local/bin/perl -wT
I would be using 'use strict;' as well, even though
you'd need to add a few my()s below.
> print "Content-type: text/html\n\n";
>
> $name = $ENV{'REMOTE_ADDR'};
> $domain = $ENV{'REMOTE_HOST'};
> print "Name = $name<BR>";
> print "Domain = $domain<BR>"; # $domain is empty
> exit;
For small print()s you might want to use qq() instead.
For multi-line printing, I would recommend a here doc.
Both these will help you get around HTML double-quoting
within your quoted string.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 19 Jun 1999 19:02:54 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: sleeping vs stopping and restarting
Message-Id: <7kgpgu$1b2c$1@nntp6.u.washington.edu>
Thanks both Tom and Dan for your replies,
In article <m3btecofou.fsf@moiraine.dimensional.com>,
Daniel Grisinger <dgris@perrin.dimensional.com> wrote:
>snow@biostat.washington.edu (Gregory Snow) writes:
>> My search of deja and the docs didn't turn up an answer.
>
>You were probably looking at Perl docs instead of Unix docs. :-)
Actually I also looked at the unix man page for sleep, I didn't find
anything there on what resources were consumed, after all
$now = time();
while(1){ last if( (time()-$now)>60*60 ) }
will "suspend execution" for an hour, but I expect it will consume a
lot more resources than sleep(60*60) would (and I wasn't sure that
perl used the same method as unix)
>You could do this with sleep(), but you really don't want to. It
>would be False Laziness-- avoiding lots of work now in favor of lots
>of work later. :-)
>
>It seems that the main reason you want to use sleep is to avoid having
>to write code to handle saving your application's state and
>reinstantiating it later.
Actually, I wrote a module a while ago to do this (it still takes a
little work and thought to use the module, but much less), I wondered
if I gone to more work than I needed to, It's nice to know that I
didn't (the learning would still have made it worth wile).
Should I clean the module up, add more documentation, and submit it to
CPAN? Are enough others interested in this to make it worth the space
it would take up?
>All in all, if it won't be amazingly difficult to make your app start
>and stop every day, I'd say use cron. If it will be amazingly
>difficult to start and stop the app I'd rethink the design.
When I've done this, I've used "at" instead of "chron" (reseting at
after saving the state, just before exiting), here are my
reasons:
1. at keeps the same directory and environment (I know that's lazy to
not do the extra work to make it run under chron, but isn't some
laziness a good thing?)
2. When the program finishes, it does not run again, if I used chron
and it finished over a weekend, it would still run a couple more times
but not do anything plus I'd have to manualy start and stop the chron
process rather than having the script automate the at.
Are there advantages to chron over at that I'm not seeing?
Thanks again,
--
-------------------------------------------------------------------------------
Gregory L. Snow | Matter cannot be created or destroyed,
(Greg) | nor can it be returned without a receipt.
snow@biostat.washington.edu |
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6058
**************************************