[17338] in Perl-Users-Digest
Perl-Users Digest, Issue: 4760 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 30 09:05:26 2000
Date: Mon, 30 Oct 2000 06:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972914710-v9-i4760@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 30 Oct 2000 Volume: 9 Number: 4760
Today's topics:
Re: Anyone knows a little about www.listsitepro.com ? (Gwyn Judd)
Re: Comparing two files <dlorre@caramail.com>
Re: Errors from 'make test' while installing 5.6.0 (Anno Siegel)
Re: even or odd ? <bart.lateur@skynet.be>
Re: giving , another name, like "and" for && (was: rena (Anno Siegel)
how to read text from filehandle only if it's there to <a@b.c>
Re: indirect sub call with strict (Martien Verbruggen)
Re: Linked lists (Anno Siegel)
Re: list of exit codes <a@b.c>
Re: looking for speech recognition evaluator in perl (Anno Siegel)
Passing java parameters from Perl <gary.berger@odnss.com>
Re: pattern matching help ( ~s/// ) <olthoff@multiboard.com>
Re: Perl/cgi coder salaries (Tad McClellan)
problem with REFERER tzoko@my-deja.com
Re: problem with REFERER <jorgen@bos.nl>
Re: Sending image into server. (Martien Verbruggen)
Tag Stripping/Regular Expression <mark__e@my-deja.com>
Re: Tag Stripping/Regular Expression <stephenk@cc.gatech.edu>
Re: Tag Stripping/Regular Expression (Tad McClellan)
Re: truncating lines <bart.lateur@skynet.be>
Re: What about CGI.pm? <flavell@mail.cern.ch>
Re: What does this compiler message mean? (Tad McClellan)
Re: What does this compiler message mean? <jorgen@bos.nl>
Re: Which is the best PERL learning book? (Tad McClellan)
Why Sybase error msg appear and yet can work? <darrent@8layer.com>
xchat script hassle <staeci@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 Oct 2000 13:43:50 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Anyone knows a little about www.listsitepro.com ?
Message-Id: <slrn8vquok.ggo.tjla@thislove.dyndns.org>
I was shocked! How could Jean-Frédéric Poitras <jf.poitras@sympatico.ca>
say such a terrible thing:
>I have an acocunt at www.listsitepro.com, but i'm wondering how to use the
>templates, anyone knows alittle about the List Site Pro templates ?
And your Perl question is? No on second thoughts, don't answer that, I
don't want to know. Go someplace else. No really. Surely this serverco
has people who can help you.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
As to the Adjective: when in doubt, strike it out.
-- Mark Twain, "Pudd'nhead Wilson's Calendar"
------------------------------
Date: Mon, 30 Oct 2000 13:33:38 GMT
From: Dominique Lorre <dlorre@caramail.com>
Subject: Re: Comparing two files
Message-Id: <8tjtbi$e7p$1@nnrp1.deja.com>
In article <8ti92m$pl1$1@hermes.nz.eds.com>,
"Peter Sundstrom" <peter.sundstrom@eds.com> wrote:
> I'm using the following code to compare two files:
...
> sub Filecmp {
> my ($file1,$file2) = @_;
>
> system("cmp $file1 $file2 >/dev/null");
> return $?;
> }
>
...
> I'm not interested in what the differences are, only if the files
> are the same or different.
>
I suggest you compare the two files only if their sizes are identical,
this would increase your code speed dramatically (different sizes =>
different files).
HTH
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 30 Oct 2000 12:02:16 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Errors from 'make test' while installing 5.6.0
Message-Id: <8tjo08$emt$1@lublin.zrz.tu-berlin.de>
Ed Berry <ehberry@uswest.com> wrote in comp.lang.perl.misc:
>My configuration is:
>
>SCO Openserver 5.0.0
>current Perl is 5.00404
>upgrading to 5.6.0
>using cc
>
>The errors I am getting in 'make test':
>
>lib/socket...........Can't load '../lib/auto/Socket/Socket.so' for
>module Socket: dynamic linker: ./perl: relocation error: symbol not
>found: PL_stack_sp at ../lib/XSLoader.pm line 73.
>at ../lib/Socket.pm line 450
>Compilation failed in require at lib/socket.t line 14.
>BEGIN failed--compilation aborted at lib/socket.t line 14.
>FAILED at test 0
>
>This is one of many messages I get when I run 'make test'. 'sh
>Configure -de' ran OK. 'make' ran fine.
>
>The symbol not found is always 'PL_stack_sp' but the can't load messages
>are different: Glob.so, SysV.so, IO.so...
In 5.6.0 a number of names in the source have been given the prefix
"PL_" which the predecessors didn't have. While this is generally
a good thing, modules that refer directly to symbols must get this
right, meaning that the module must be upgraded to comply with the
naming convention. Find out if there is a compliant version of
Socket.pm.
If there isn't, you must supply the flag "_DPERL_POLLUTE" to the
compiler. Then the old names (without the PL_-prefix) will be
compiled along with the new ones. This can be done using the right
incantation when you generate the Makefile via "perl Makefile.PL".
I think it's "perl Makefile.PL POLLUTE=1".
Anno
------------------------------
Date: Mon, 30 Oct 2000 13:28:06 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: even or odd ?
Message-Id: <aqtqvsk52ue9esgrg0869114qk3r3603fm@4ax.com>
Billy wrote:
>Does an instruction exist which can test if an number is odd (eg 1, 3,
>5, ...) or even (eg 2, 4, 6, 8, ...) ?
When is a number even? When it's divisible by two. How do you test if a
number is divisible by $n? If that number module $n is zero. What is the
modulo operator in Perl? "%".
--
Bart.
------------------------------
Date: 30 Oct 2000 11:34:44 -0000
From: anno4000@lublin.zrz.TU-Berlin.DE (Anno Siegel)
Subject: Re: giving , another name, like "and" for && (was: renaming local())
Message-Id: <8tjmck$ejj$1@lublin.zrz.tu-berlin.de>
Ren Maddox <ren.maddox@tivoli.com> wrote in comp.lang.perl.misc:
>OK, that's downright scary... Off-hand, I cannot think of any other
>binary operator (in Perl) that can be used twice in a row without an
>intervening operand.
...though the comma operator might be a candidate when it comes to
breaking this rule. I have sometimes thought it might be handy to
be able to use multiple commas in a row for a series of undef's:
func( $w, undef, undef, $z) would become func( $w,,, $z). Now some-
one will point out the horrible ramifications of this naive suggestion.
Of course, the proposed "then" operator is quite another case.
The standard comma operator (well, the list-building comma operator)
inserts both its (scalar) operands into the list being built. "Then",
however, must see its left operand as a list in which *not* to include
the right operand(s). But if the left operand is a list, the empty
list is a possibility, so the case of an empty operand must be allowed.
Anno
------------------------------
Date: Mon, 30 Oct 2000 13:37:55 -0000
From: "Kingsley Tart" <a@b.c>
Subject: how to read text from filehandle only if it's there to read?
Message-Id: <VReL5.29182$h%4.215029@news2-win.server.ntlworld.com>
I'm trying to write some script that reads from a socket but if there's no
more input,
continues round the loop doing other things. When it comes back to the top
of the
look again, I want it to read further input if it is there, else keep going,
eg:
while (!finished)
{
while (defined($textline=<CLIENTSOCKIN>))
{ print SERVERSOCKOUT $textline; }
# other loop code goes here ...
}
The problem is that when it has read all of the input from CLIENTSOCKIN,
rather
than quitting the inner while loop and doing the rest of the code, it sits
there waiting
for more input. I have also tried this:
while (!finished)
{
while (!eof CLIENTSOCKIN)
{
$textline=<CLIENTSOCKIN>;
print SERVERSOCKOUT $textline;
}
# other loop code goes here ...
}
However, this does exactly the same. The only way round it I've found is
to set a short SIG alarm which closes CLIENTSOCKIN when activated
but this makes things slow. Surely there must be a better way?
--
Cheers,
Kingsley
k ingsl ey at sk 4 y mark 3 et dot 34 co dot 4 uk (remove the digits)
------------------------------
Date: Mon, 30 Oct 2000 23:06:55 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: indirect sub call with strict
Message-Id: <slrn8vqp2v.ac5.mgjv@martien.heliotrope.home>
[please in the future, post your reply _after_ the _suitably trimmed_
text you reply to. It makes you post easier to read, and it is in
accordance with the generally accepted posting style on this group, and
Usenet in general]
On Mon, 30 Oct 2000 10:29:43 GMT,
grey_owl7@my-deja.com <grey_owl7@my-deja.com> wrote:
[re-ordered, and severely trimmed post]
> Viktor
>
> In article <39F85C34.2477F7BB@yahoo.co.uk>,
> Nick Condon <nickco3@yahoo.co.uk> wrote:
>
> > Use a hash with hard references in it instead:
> >
> > #!/usr/local/bin/perl -w
> > use strict;
> >
> > my %func = (
> > "Bingo" => sub {print "It's Bingo!\n"},
> > "Bongo" => sub {print "No, it's Bongo!\n"}
> > );
> >
> > my $beg = "Bi";
> > my $full = $beg."ngo";
I'd probably write that as
my $full = "${beg}ngo";
but that's personal preference.
> > $func{$full}->();
> > print "1 $full\n";
> >
> > $beg = "Bo";
> > $full = ($beg).("ngo");
But I would most definitely get rid of these brackets. They serve no
purpose at all.
$full = "${beg}ngo";
> > print "2 $full\n";
> >
> > $func{$full}->();
> > print "\n";
>
> Thanks for the tip, Nick. But with your code I still get:
> syntax error at ./test_subcall.pl line 9, near "->("
No, you don't. The code that Nick gave you does not contain '->(' on
line 9. Besides that, it runs fine. Instead of making people guess, why
don't you just cut the old code that you obviously didn't copy, from the
post, and submit your own, evidently faulty, code. That way we can point
out what you did wrong. Now we can't. Because all the code we see, is
correct.
What is odd, is that the line number the error appeared on isn't 17. or
7 or 11.
Martien
--
Martien Verbruggen |
Interactive Media Division | +++ Out of Cheese Error +++
Commercial Dynamics Pty. Ltd. | Reinstall Universe and Reboot +++
NSW, Australia |
------------------------------
Date: 30 Oct 2000 12:41:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Linked lists
Message-Id: <8tjq9n$eoo$1@lublin.zrz.tu-berlin.de>
Keywords: Colosseum, devotee, pod, splintery
Mark-Jason Dominus <mjd@plover.com> wrote in comp.lang.perl.misc:
>
>
>I once said that linked list structures are never useful in Perl, and
>that the things they are useful for in other languages are almost
>always better-served by arrays.
>
>However, last week I found an exception.
While we are eagerly waiting for more, let me mention that sparse
matrix implementations often use linked lists to join the rows and
columns of a matrix together. It is hard to see how arrays could
replace linked lists without spoiling the effect of sparse matrix
storage.
Anno
------------------------------
Date: Mon, 30 Oct 2000 13:25:33 -0000
From: "Kingsley Tart" <a@b.c>
Subject: Re: list of exit codes
Message-Id: <jGeL5.29169$h%4.214653@news2-win.server.ntlworld.com>
OK, ta.
------------------------------
Date: 30 Oct 2000 13:44:46 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: looking for speech recognition evaluator in perl
Message-Id: <8tju0e$erj$1@lublin.zrz.tu-berlin.de>
<nobull@mail.com> wrote in comp.lang.perl.misc:
> ...often quite knowlegible about fuzzy atching algoriths.
Seems to be a valuable asset.
Anno
------------------------------
Date: Mon, 30 Oct 2000 07:51:32 -0500
From: "Gary L. Berger" <gary.berger@odnss.com>
Subject: Passing java parameters from Perl
Message-Id: <39fd6e2d$1_2@corp.newsfeeds.com>
I am having a problem passing parameters to java from Perl in a CGI script.
The quotes are giving me a problem. Any suggestions?
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Mon, 30 Oct 2000 09:00:50 -0500
From: "Darryl Olthoff" <olthoff@multiboard.com>
Subject: Re: pattern matching help ( ~s/// )
Message-Id: <8tjuuk$8fd$1@panther.uwo.ca>
"arthur" <star@sonic.net> wrote in message
news:B61CA1C3.9D19%star@sonic.net...
> in article 39e3b80f.0@206.30.194.5, jim and lois at kf4dmb@net-magic.net
> wrote on 10/10/00 4:38 PM:
>
> > $string = " t:\test/one/jim.txt";
> > $string = ~s ///\/ ;
> >
> > I get errors . what am I doing wrong ?
What is it that you are trying to do? Are you trying to replace / with \?
If so you will want to do this:
$string =~ s!/!\\!g;
------------------------------
Date: Mon, 30 Oct 2000 07:19:43 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl/cgi coder salaries
Message-Id: <slrn8vqpqv.3mv.tadmc@magna.metronet.com>
On 29 Oct 2000 19:53:20 GMT, Tarael200 <tarael200@aol.com> wrote:
>Very recently, within the past day I think, there was a job advertisement for a
>perl/cgi programmer, for $25-30/hour.
>
>Someone posted $50-90 was the going salary, as of a 1997 survey.
^^^^^^ ^^^^^^
I doubt that anybody works for 50-90 dollars a year.
"salary" and "per hour" are mutually exclusive.
>My friend, you are quite wrong IIRC,
No I am not.
I said what the going contract rate was in 1998, and that _is_ what
the going rate was.
You seem to imply that I said that rate is applicable today.
I did not. That is, in fact, why I included the date, because
I haven't checked up on rates since then.
( see also realrates.com, a respected rate survey site )
>for then they were rare. Now, they are but
>a dime a dozen.
Then web sites were rare, now they are but a dime a dozen.
You seem to be making a supply and demand argument.
^^^^^^^^^^
The supply has increased, I'll give you that.
What has happened to the demand relative to the supply?
Even kids in elementary school know what dot-com is today. I doubt
that was the case in 1998.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 Oct 2000 12:40:30 GMT
From: tzoko@my-deja.com
Subject: problem with REFERER
Message-Id: <8tjq7u$bv0$1@nnrp1.deja.com>
Hello,
I've struggled with this almost 4 days and can't get it to work.
I need a perl script, which redirects the user to external link. I need
this script to modify the HTTP_REFERER. (I don't want to show where
exactly the user came from.)
I tried with headers, but it doesn't work:
print "Location: http://site_to_go/\n",
"Referer: http://elsewhere.com/\n\n",
"Content-type: text/html";
tried with CGI.pm too - same success :(
Can anyone give me a hint ?
Thanks in advance.
Ivan Tzukev
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 30 Oct 2000 14:36:28 +0100
From: "Jørgen Teunis" <jorgen@bos.nl>
Subject: Re: problem with REFERER
Message-Id: <972912964.972541@proxy.bos.nl>
I thought this isn't posible, you can't set a HTTP_REFERER because the
browser set's it.....
If you have the solution i would be pleased to hear, but i don't think there
is one.
Kind regards,
Jørgen
<tzoko@my-deja.com> schreef in bericht news:8tjq7u$bv0$1@nnrp1.deja.com...
> Hello,
>
> I've struggled with this almost 4 days and can't get it to work.
>
> I need a perl script, which redirects the user to external link. I need
> this script to modify the HTTP_REFERER. (I don't want to show where
> exactly the user came from.)
>
> I tried with headers, but it doesn't work:
>
> print "Location: http://site_to_go/\n",
> "Referer: http://elsewhere.com/\n\n",
> "Content-type: text/html";
>
> tried with CGI.pm too - same success :(
>
> Can anyone give me a hint ?
>
> Thanks in advance.
>
> Ivan Tzukev
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Mon, 30 Oct 2000 22:58:06 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Sending image into server.
Message-Id: <slrn8vqoie.ac5.mgjv@martien.heliotrope.home>
On Mon, 30 Oct 2000 12:34:05 +0200,
foo <keisari_@hotnail.com> wrote:
> I would need a script, that would send file from my PC to a server.
> I have Perl in both machines.
> Image size is about 120kb.
>
> I have thought someting like that:
>
> 1. read image into scalar (in my PC).
> 2. send it into a cgi file with post method as http (maybe with LWP).
Don't do that. Use FTP, or maybe the HTTP PUT method.
Get yourself Net::FTP, and the libwww (LWP) modules from CPAN, or if you
use ActiveState from their repository, with the ppm tool.
This is what FTP is for. How would you get your program on the server?
With FTP is suppose? So, use it to get images there as well.
Martien
--
Martien Verbruggen |
Interactive Media Division | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd. | password?
NSW, Australia |
------------------------------
Date: Mon, 30 Oct 2000 11:07:23 GMT
From: mark__e <mark__e@my-deja.com>
Subject: Tag Stripping/Regular Expression
Message-Id: <8tjkp8$885$1@nnrp1.deja.com>
I've been trying to work out a fairly robust regular expression for
highlighting tags in html (trying to teach myself!), I've ended up with
the following which seems to work ok, but as this is the first time I
have tried reg exp's I would appreciate any feedback as to potential
pitfalls etc. (or if I've just plain got it wrong.)
<\s*\/?tagname\b[\w|\W]*?>
< find a <
\s* any amount of spaces
\/? 0 or 1 /
tagname
\b word boundary
[\w|\W]*? any thing at all, but non greedy so it keeps checking for the
>
I didn't use .*? as I wanted to pick up if a new line had been hit in
between the <>.
That’s my reasoning :-)
Mark
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 30 Oct 2000 07:33:56 -0500
From: Stephen Kloder <stephenk@cc.gatech.edu>
Subject: Re: Tag Stripping/Regular Expression
Message-Id: <39FD6AB4.2CA3E25F@cc.gatech.edu>
mark__e wrote:
> I've been trying to work out a fairly robust regular expression for
> highlighting tags in html (trying to teach myself!), I've ended up with
> the following which seems to work ok, but as this is the first time I
> have tried reg exp's I would appreciate any feedback as to potential
> pitfalls etc. (or if I've just plain got it wrong.)
>
> <\s*\/?tagname\b[\w|\W]*?>
>
> < find a <
> \s* any amount of spaces
> \/? 0 or 1 /
> tagname
> \b word boundary
> [\w|\W]*? any thing at all, but non greedy so it keeps checking for the
> >
> I didn't use .*? as I wanted to pick up if a new line had been hit in
> between the <>.
>
> That’s my reasoning :-)
>
> Mark
>
For this sort of task, you're better off using HTML::Parser, as there are
other cases that are tricky to match (like < and > appearing in the page
not as tag delimeters).
However, you could use some more info on regexes in general:
Right now you have /<\s*\/?tagname\b[\w|\W]*?>/
1) The /s switch causes '.' to match newlines as well
2) You can use an alternate delimeter (like m##) so you don't have to
escape the slash.
So something like m#<\s*/?tagname\b.*?>#s or even m#<\s*/?\w+\b.*?>#s would
be nicer. You can even use the /x tag to comment your regexes:
m!< # find a <
\s* # any amount of spaces
/? # 0 or 1 /
\w+ # tagname
\b # word boundary
.*? # any thing at all, but non greedy so it keeps checking for the
>!xs
perldoc perlre
perldoc HTML::Parser
--
Stephen Kloder | "I say what it occurs to me to say.
stephenk@cc.gatech.edu | More I cannot say."
Phone 404-874-6584 | -- The Man in the Shack
ICQ #65153895 | be :- think.
------------------------------
Date: Mon, 30 Oct 2000 07:07:13 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Tag Stripping/Regular Expression
Message-Id: <slrn8vqp3h.3mv.tadmc@magna.metronet.com>
On Mon, 30 Oct 2000 11:07:23 GMT, mark__e <mark__e@my-deja.com> wrote:
>I've been trying to work out a fairly robust regular expression for
>highlighting tags in html (trying to teach myself!),
Use it only for learning, don't use it for real work, because
it won't work for all HTML, just for some HTML.
e.g. <img src="cool.jpg" alt=">>>Cool pic!<<<">
For work, you should be using a module that parses HTML
rather than a regex.
>I've ended up with
>the following which seems to work ok, but as this is the first time I
>have tried reg exp's I would appreciate any feedback as to potential
>pitfalls etc. (or if I've just plain got it wrong.)
>
><\s*\/?tagname\b[\w|\W]*?>
^^^
HTML (SGML) does not allow any spaces there. You should take that out.
>< find a <
>\s* any amount of spaces
>\/? 0 or 1 /
>tagname
You should pattern match the tagname too:
[a-zA-Z][a-zA-Z0-9.-]*
Starts with a letter, followed by zero or more letters, digits, dots, hyphens.
>[\w|\W]*? any thing at all, but non greedy so it keeps checking for the
You have included the vertical bar twice in your character class,
no need to do that, once is enough:
[\w\W]
( vertical bar is not "meta" in characters classes
>I didn't use .*? as I wanted to pick up if a new line had been hit in
>between the <>.
You can instead add the m//s option to make dot match newline characters.
And the m//x option would allow you to put your comments right
in your regex code.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 Oct 2000 13:25:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: truncating lines
Message-Id: <mjtqvss0ancq9sqf0mjf00rp8geqbc306u@4ax.com>
Chris Coffey wrote:
>What I want to do is this. I need to create output from a file such that
>if there is a space, a line feed will be performed, so each word will have
>there own line. Example: this is a line
>
>this
>is
>a
>line
$_ = "This is a line.\n So is this.\n";
s/\s+/\n/g;
print;
--
Bart.
------------------------------
Date: Mon, 30 Oct 2000 11:45:34 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: What about CGI.pm?
Message-Id: <Pine.GHP.4.21.0010301122010.6847-100000@hpplus03.cern.ch>
On Mon, 30 Oct 2000, Steve wrote:
> My point exactly. If all you want to do is parse the query string
Experience shows that if you start that way, with anything but an
entirely trivial script, you'll end up with lots of kludges bolted on
afterwards.
> and
> you are using a Unix based server then you can simply work with
> $ENV{QUERY_STRING} and parse it yourself if need be.
I don't know why you think this is specific to Unix. Additional
benefits of CGI.pm include that it parses POST method without extra
work on your part, it isn't limited to method GET. And it provides a
handy online debugging mode. It also protects you from some browser
bugs that are known to the author but may well not be known to you.
> Others may have different suggestions.
The overhead of invoking any CGI script is non-trivial. The overhead
of starting-up any Perl program is non-trivial.
By comparison the overhead of CGI.pm loading the parts that you use is
relatively low; if you care, then you'd better look and see which
version of CGI.pm you're using - some of them are cleverer than others
about this.
The overhead of debugging a hand-knitted CGI script is non-trivial.
Some of the bugs, you won't find, because you're not inventive enough
to create the data that provokes them - but your users might very well
do that for you. By which time it could be too late.
There's no particular benefit in getting the wrong answer fast. If you
wanted to speed things up, you'd be better looking for a faster way to
invoke Perl CGI scripts in general (such as mod_perl), than trying to
demolish a well-tried module. When you've reached the level where you
know when to use and when not to use CGI.pm (I'm pretty sure I haven't
got there yet) then you'll know what you're doing, and you won't be
asking for advice about it here.
As long as you are asking, I'd say the answer is to use CGI.pm from
the outset, see how it works out: if it proves too costly, then
consider moving to mod_perl or similar arrangements.
If you really want to know about efficiency, then run some benchmarks.
Gut feelings often turn out to be wrong.
------------------------------
Date: Mon, 30 Oct 2000 07:31:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What does this compiler message mean?
Message-Id: <slrn8vqqh3.3rb.tadmc@magna.metronet.com>
On Mon, 30 Oct 2000 13:16:39 GMT, Al <nospamapgraham@ispchannel.com---> wrote:
>
>I've seen this when trying to use taint checking in other scripts
>also.
>
>
>$ perl -c edit.cgi
>Too late for "-T" option at edit.cgi line 1.
All of the messages that perl might issue are documented in
the perldiag.pod standard doc. You should look them up there
before posting.
perldoc perldiag
--------------------------------
=item Too late for "B<-T>" option
(X) The #! line (or local equivalent) in a Perl script contains the
B<-T> option, but Perl was not invoked with B<-T> in its command line.
This is an error because, by the time Perl discovers a B<-T> in a
script, it's too late to properly taint everything from the environment.
So Perl gives up.
If the Perl script is being executed as a command using the #!
mechanism (or its local equivalent), this error can usually be fixed
by editing the #! line so that the B<-T> option is a part of Perl's
first argument: e.g. change C<perl -n -T> to C<perl -T -n>.
If the Perl script is being executed as C<perl scriptname>, then the
B<-T> option must appear on the command line: C<perl -T scriptname>.
--------------------------------
>P.S. Should I have written a better subject line?
Looks fine to me.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 Oct 2000 14:30:24 +0100
From: "Jørgen Teunis" <jorgen@bos.nl>
Subject: Re: What does this compiler message mean?
Message-Id: <972912601.271121@proxy.bos.nl>
I don't know for sure, i don't use this, but i think it's because here $
perl -c edit.cgi you don't use a -T
And probably at your first line there is something like:
#!/usr/bin/perl -T
Then the -T there is to late because you allready used the options at the
commandline.
I can't think of an other answer, i hope this is correct, but don't shoot me
if it isn't ;)
Greetings
Jørgen
"Al" <nospamapgraham@ispchannel.com---> schreef in bericht
news:39fd73c3.60097036@news.ispchannel.com...
>
> I've seen this when trying to use taint checking in other scripts
> also.
>
>
> $ perl -c edit.cgi
> Too late for "-T" option at edit.cgi line 1.
>
> -Al-
> P.S. Should I have written a better subject line?
------------------------------
Date: Mon, 30 Oct 2000 07:23:54 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Which is the best PERL learning book?
Message-Id: <slrn8vqq2q.3mv.tadmc@magna.metronet.com>
On Mon, 30 Oct 2000 00:59:01 -0800, Peter <al@bnospamb.cc> wrote:
>Is it the Camel book
No. The Camel is a reference, not a tutorial.
>or the llama book or Beginning PERL?
I assume you mean "Beginning Perl" instead.
Those are both fine books.
A third good tutorial book is "Elements of Programming With Perl",
by Andrew Johnson.
>I am trying to learn perl. Does perl have a brigth future?
Most likely yes.
>How about
>php?
We wouldn't know.
You should ask PHP people, not Perl people, about PHP :-)
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 Oct 2000 19:06:45 +0800
From: "Darren Tan" <darrent@8layer.com>
Subject: Why Sybase error msg appear and yet can work?
Message-Id: <8tjkr7$25b$1@newton3.pacific.net.sg>
I use wwwthreads forum and can connect to MySQL. However, i am trying to
connect to Sybase database.
I use win2000 and the IIS webserver and latest ActivePerl.
I managed to connect to Sybase using perl and DBI.
However, when i compile the script using the command:
perl <script file>.pl
I always get the following error:
Open Client Message:
Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (131)
Message String: ct_init(): network packet layer: internal net library error:
Att
empt to spawn thread failed
install_driver(Sybase) failed: DBD::Sybase initialize: ct_init() failed at
D:/Pe
rl/lib/DynaLoader.pm line 221.
Compilation failed in require at (eval 2) line 3.
at ..//w3t.pm line 482
Strange thing is: I can run those perl scripts and connect to Sybase using
http://<host>/a1.pl
and i can retrieve those data from Sybase but not using perl <script.pl>.
I wanted to know because i wanted to use it for debugging purpose.
Would appreciate if anyone can respond to me.
Thanks and regards
Darren
------------------------------
Date: Mon, 30 Oct 2000 11:54:49 GMT
From: "Darrin Mison" <staeci@yahoo.com>
Subject: xchat script hassle
Message-Id: <dkdL5.4490$Tq6.49324@news-server.bigpond.net.au>
I want a script which will trigger when somoneone types
in a key phrase and then sends them a file.
I can get it to do everything but the file gets queued
at my end and never even shows its face at the other
user's end.
I assume that there is something wrong with my use of /dcc
but I'm damned if I can figure it out. Help please.
if ($msg eq "fetch")
{
# IRC::command("test return ".$nick); # just to test if trigger working
IRC::command("/dcc send $nick $file");
}
------------------------------
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 4760
**************************************