[12905] in Perl-Users-Digest
Perl-Users Digest, Issue: 315 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 30 16:07:18 1999
Date: Fri, 30 Jul 1999 13:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 30 Jul 1999 Volume: 9 Number: 315
Today's topics:
Re: <<END_OF_TEXT function <flavell@mail.cern.ch>
Re: <<END_OF_TEXT function <paulreid@cableinet.co.uk>
Re: <<END_OF_TEXT function (Mike G.)
Re: <<END_OF_TEXT function <paulreid@cableinet.co.uk>
Re: <<END_OF_TEXT function <AgitatorsBand@yahoo.com>
Re: <<END_OF_TEXT function <emschwar@rmi.net>
Re: Beginner-friendly group as cultural adaptation? (Reini Urban)
Re: business graphics with perl makarand_kulkarni@my-deja.com
Re: CGI.pm bug? repeating values (brian d foy)
Re: Date incrementing <aqumsieh@matrox.com>
Re: Easy way to emulate Unix's "sort" command? (Larry Rosler)
Re: framekeeper.pl (Abigail)
Help: IO::Socket not working <gregory_guerin@hp.com>
Re: Hey, that's pretty neat! (Bart Lateur)
Re: Hey, that's pretty neat! (Sean McAfee)
Re: Hey, that's pretty neat! <tchrist@mox.perl.com>
Re: how good is fork() ? <aqumsieh@matrox.com>
How is perl braindamaged? (was Re: Is LISP dying?) (Reini Urban)
Re: How to count clicks to HTML link. (brian d foy)
Re: How to read the submit button as a name or value (brian d foy)
Re: How to read the submit button as a name or value <Floyd@NewWebSite.com>
Re: Newbie alert !! <aqumsieh@matrox.com>
Re: passing a list of hashes to a subroutine? <aqumsieh@matrox.com>
Re: perl IP to OS mapping help <qwerty@post.utfors.se>
Re: qc check on dir (Mike G.)
Re: remove records from database inlandpac@my-deja.com
Re: remove records from database (Twarren10)
running programs from inside perl olumsbaba@my-deja.com
Re: system function broken - ActivePerl - build 517 or <bivey@teamdev.com>
Re: when writing to data file, last letter is missing <aqumsieh@matrox.com>
Re: when writing to data file, last letter is missing <hal_mounce@amdahl.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 30 Jul 1999 20:59:53 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: <<END_OF_TEXT function
Message-Id: <Pine.HPP.3.95a.990730205434.23653D-100000@hpplus03.cern.ch>
On 30 Jul 1999, John Callender wrote:
> You probably need to check your server's error log, or try running the
> script manually from the shell,
Can I put in a good word for the routine use of
use CGI::Carp qw(fatalsToBrowser);
when working with scripts in a CGI environment?
While it's likely in this case that the problem with the script would
show up also when run from the shell, there are lots of problems in the
CGI-ish environment that won't show up from the shell, and it's a bore
having to examine the entrails of the server's error log.
[We now return you to your discussion of the Perl language...]
------------------------------
Date: Fri, 30 Jul 1999 20:14:14 +0100
From: Paul Christopher Reid <paulreid@cableinet.co.uk>
Subject: Re: <<END_OF_TEXT function
Message-Id: <37A1F985.C640DD58@cableinet.co.uk>
Hi and thanks for the help,
I am a bit of a newbie so please excuse me if I start gibbering
codswallop.
Here is the code
I took it straight from the book by M&T books
Introduction to CGI/PERL:
#!/usr/bin/perl
require "cgi-lib.pl";
%translateHi = (
"english", "Hello",
"french", "Bonjour",
"klingon", "nuqneH",
"spanish", "Hola",
"japan", "Konnichiwa"
);
%translateHow = (
"english", "How are you?",
"french", "Comment allez vous?",
"klingon", "",
"spanish", "Que tal?",
"japan", "Ikagadesuka?"
);
MAIN:
{
&ReadParse
print &PrintHeader;
print &HtmlTop("Greetings of the world");
print <<END_OF_TEXT;
<P>Your translation reads:</P>
<BLOCKQUOTE>
$translateHi{$in{'lang'}}, $in{'who'} $translateHow{$in{'lang'}}
</BLOCKQUOTE>
END_OF_TEXT
if($in{'params'}){
print "<H2>the cgi form parameters...</H2>\n";
print &PrintVariables(%in);
}
print &HtmlBot;
}
I didn't understand what you meant by running it from shell and I would like
to know more about this. I have to load to my server (I use cute FTP) and
cannot telnet. I have been trying to run cgi/perl scripts on my pc for testing
by using MS PWS but I cant get that to work.
Mike G. wrote:
> paulreid@cableinet.co.uk (Paul Christopher Reid):
> > I have tried to execute a script with the <<END_OF_TEXT function for the
> > first time without results. I keep getting internal server error and i
> >
>
> Where's your code?
>
> --
> Mike G.
------------------------------
Date: 30 Jul 1999 19:29:08 GMT
From: tcsh@holly.colostate.edu (Mike G.)
Subject: Re: <<END_OF_TEXT function
Message-Id: <slrn7q3v84.155s.tcsh@yuma.ACNS.ColoState.EDU>
> print <<END_OF_TEXT;
> <P>Your translation reads:</P>
> <BLOCKQUOTE>
> $translateHi{$in{'lang'}}, $in{'who'} $translateHow{$in{'lang'}}
> </BLOCKQUOTE>
> END_OF_TEXT
^
Spaces count. Get rid of that or prepend it to END_OF_TEXT
> to know more about this. I have to load to my server (I use cute FTP) and
> cannot telnet. I have been trying to run cgi/perl scripts on my pc for testing
> by using MS PWS but I cant get that to work.
Well, I suppose if you can't telnet in to the server or get perl on your
pc, you're out of luck.
--
Mike G.
------------------------------
Date: Fri, 30 Jul 1999 20:39:54 +0100
From: Paul Christopher Reid <paulreid@cableinet.co.uk>
Subject: Re: <<END_OF_TEXT function
Message-Id: <37A1FF8A.8438F01B@cableinet.co.uk>
I get Internal server error , premature end of script.
How do you get Perl on your pc?
Mike G. wrote:
> > print <<END_OF_TEXT;
> > <P>Your translation reads:</P>
> > <BLOCKQUOTE>
> > $translateHi{$in{'lang'}}, $in{'who'} $translateHow{$in{'lang'}}
> > </BLOCKQUOTE>
> > END_OF_TEXT
> ^
> Spaces count. Get rid of that or prepend it to END_OF_TEXT
>
> > to know more about this. I have to load to my server (I use cute FTP) and
> > cannot telnet. I have been trying to run cgi/perl scripts on my pc for testing
> > by using MS PWS but I cant get that to work.
>
> Well, I suppose if you can't telnet in to the server or get perl on your
> pc, you're out of luck.
>
> --
> Mike G.
------------------------------
Date: Fri, 30 Jul 1999 19:48:17 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: <<END_OF_TEXT function
Message-Id: <5kno3.223$ri7.6232@news.shore.net>
Paul Christopher Reid <paulreid@cableinet.co.uk> wrote:
: I took it straight from the book by M&T books
All well and good, but sometimes you have to be careful cutting and
pasting from books.
: #!/usr/bin/perl
First of all, this should be flush with the left margin. Did you really
enter it with the spaces before the #! or is that a typo?
: require "cgi-lib.pl";
People will tell you to use CGI instead of this library -- and they're
probably right -- but this isn't the cause of your problem and for parsing
the input of simple cgi scripts, cgi-lib should work fine.
: MAIN:
: {
: &ReadParse
: print &PrintHeader;
: print &HtmlTop("Greetings of the world");
: print <<END_OF_TEXT;
: <P>Your translation reads:</P>
: <BLOCKQUOTE>
: $translateHi{$in{'lang'}}, $in{'who'} $translateHow{$in{'lang'}}
: </BLOCKQUOTE>
: END_OF_TEXT
Aha. You're getting "clever" here. Whose idea was it to put the "main"
body of code in this MAIN: block? If it was your book's, you might want to
find another book.
Anyway, your problem is that the here-document syntax ( << ) expects to
see the specified token ("END_OF_TEXT" in this case) flush against the
left margin. In your case, you have inserted a space (if this is really
exactly the way it appears in the book, then you *really* need a new
book!). Move "END_OF_TEXT" so there are no spaces to the left of it and
that should work.
: I didn't understand what you meant by running it from shell and I would like
: to know more about this. I have to load to my server (I use cute FTP) and
: cannot telnet.
Running it from the shell means that you telnet to the server (assuming
it's not local and it sounds like it isn't in your case) and execute the
program from the command line (by typing its name) rather than executing
it via CGI (i.e. invoking it from your web browser).
: I have been trying to run cgi/perl scripts on my pc for testing
: by using MS PWS but I cant get that to work.
Did you install perl on your PC? If so, you should be able to run the
scripts from the (DOS) command line without setting up PWS. If not, you're
not going to be able to run them as CGIs either. :)
Good luck.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 30 Jul 1999 14:02:11 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: <<END_OF_TEXT function
Message-Id: <xkfvhb1hpoc.fsf@valdemar.col.hp.com>
Paul Christopher Reid <paulreid@cableinet.co.uk> writes:
> I have tried to execute a script with the <<END_OF_TEXT function
It's not a function, it's a here-document. perldoc perldata, and search
for "here-doc".
> for the first time without results. I keep getting internal server
> error and i have checked and rechecked for typos. Is this special
> funtion called from the cgi-lib.pl file ????
Okay, I see several problems already:
1) An "internal server error" has bugger-all to do with Perl. However,
you can check the server logs, and you'll probably find the Perl error
message.
2) I will bet 5 pounds that you're not using "-w" and "use strict;". If
you use those, and then *fix* (not ignore) the problems they identify,
you'll be much less likely to have the kinds of errors you have.
3) You're not testing these on your own computer before you try to put
them on your web server. Get yourself your own copy of perl (if
you're on a PC, go to <URL:http://www.activstate.com/> and get
ActivePerl, if you're on a unix box, go to
<URL:http://www.perl.com/>). If you test things on your own computer,
it's much easier to fix errors.
4) You're not using CGI.pm. That "cgi-lib.pl" is old, and evil, and
shouldn't be used by anybody using a modern (read: perl5_004 or
better) Perl. "perldoc CGI" for info on how to use it. It sucks
massively less that most other attempts to parse CGI data. And it
actually works correctly.
5) Those socks... don't you ever do your laundry? :^)
> Help appreciated!
Help given!
-=Eric
------------------------------
Date: Fri, 30 Jul 1999 19:41:31 GMT
From: rurban@xarch.tu-graz.ac.at (Reini Urban)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <37a1fef9.123132104@judy.x-ray.local>
rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
>But if you really want discussion, why not post a formal RFD?
i liked the german idea of the .cgi group below perl and not under www.*
let's discuss a new comp.lang.perl.win32 and a new comp.lang.perl.cgi
group.
this would please most of you, i guess, but not the usenet advocates
because it would lead to even more traffic.
thanksfully into a more guided direction.
newbies-only groups don't work out.
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: Fri, 30 Jul 1999 19:21:25 GMT
From: makarand_kulkarni@my-deja.com
Subject: Re: business graphics with perl
Message-Id: <7nstv9$tab$1@nnrp1.deja.com>
--
You might find some articles that discuss the usage of
GnuPlot 3.7 for graphing purposes in the latest
issue (summer 1999) of The Perl Journal useful.
Also find if Graph.pm is useful.
--
In article <7njhgq$3ll1@SGI3651ef0>,
"Juan Riera" <jriera@retemail.es> wrote:
> Hello,
> I am looking for some ressources about creating database-based dynamic
> business graphics with perl.
> Any reference will be greatly appreciated.
> Thanks in advance,
> Juan
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 30 Jul 1999 15:31:37 -0400
From: brian@pm.org (brian d foy)
Subject: Re: CGI.pm bug? repeating values
Message-Id: <brian-ya02408000R3007991531370001@news.panix.com>
In article <7nsrk5$egd$1@news.fsu.edu>, bismuti@cs.fsu.edu (Peter Bismuti) posted:
> I have had a problem with several of my CGI scripts using CGI.pm.
> This is what some of the values look like after a form is used
> for a while:
>
> app_semester = FallFallFallFallFallFallFallFall
> app_year = 20002000200020002000200020002000
my first suspicion is that you are doing something wierd in your
code.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Fri, 30 Jul 1999 13:22:47 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Date incrementing
Message-Id: <x3yvhb2hx20.fsf@tigre.matrox.com>
Stone Cold <paulm@dirigo.com> writes:
> Does anyone know how to easily increment a date?
I believe the Date::Manip module will be useful. Grab it from a CPAN
site near you.
HTH,
Ala
------------------------------
Date: Fri, 30 Jul 1999 12:43:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Easy way to emulate Unix's "sort" command?
Message-Id: <MPG.120ba04cdd8a2dd8989d79@nntp.hpl.hp.com>
In article <37A1ED9A.C5843BF2@mail.cor.epa.gov> on Fri, 30 Jul 1999
11:23:22 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> Anno Siegel wrote:
> [snip]
> > Only perl can parse Perl. And Larry Rosler, apparently. How on earth
> > did you spot that missing paren in the line of comics-swearing above?
Using a slightly enhanced version of Abigail's Algorithm
<URL:http://x29.deja.com/[ST_rn=ps]/getdoc.xp?AN=439937259>:
Set a (mental) $counter to 0.
Scan code from left to right, optionally skipping comments.
When encountering a left parenthesis*, ++$counter.
When encountering a right parenthesis*,
--$counter and die if it is negative.
At end of code, die if $counter != 0.
* Except in a string, or escaped or in a character set in a regex.
Repeat for square and curly brackets, or keep three counters
simultaneously if you can multi-process that deeply (I can't :-).
> Larry cheats. He actually slaps code into an editor and runs
> it. The nerve of some people! :-)
Whyever would I do something like that with code from the FAQ,
*especially* from the one referred to so frequently (perlfaq4: "How do I
sort an array by (anything)?"? Nothing in the FAQ can go wrong ...
> Now if only I could do that all the time with my *own* code...
>
> Oh yeah, and I need a spell checker for my posts.
In a long history with adb, sdb, xdb or whatever, my most productive
tool has been edb, the Eyeball DeBugger. Read it all. Read it aloud.
Read it to your neighbor/cow-orker/spouse/sig-other/whoever. Read it,
read it, read it, read it, ...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 30 Jul 1999 14:20:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: framekeeper.pl
Message-Id: <slrn7q3un8.h2a.abigail@alexandra.delanet.com>
Benjamin Dälken (benjamin@daelken.com) wrote on MMCLIX September MCMXCIII
in <URL:news:7nrrkl$ijh$1@news01.btx.dtag.de>:
~~ does anyone now where i can get the script "framekeeper.pl" ?
Try Lycos.
~~ this is a script which takes you in the right frameset, when you only load
~~ one frame of the set.
I don't think frameset can ever be right.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 30 Jul 1999 13:24:29 -0600
From: Greg Guerin <gregory_guerin@hp.com>
Subject: Help: IO::Socket not working
Message-Id: <37A1FBEC.AB737CCC@hp.com>
I'm new to Perl and am trying to figure out how to create client and
server scripts on NT. IO::Socket Module doesn't seem to in my lib
directory. If I pull a library down how do I make Perl know it's
there. Just putting it in the lib directory doesn't seem to work. And
is there a difference between an module for NT vs. UX? Thanks in
advance!
Greg Guerin
gregory_guerin@hp.com
------------------------------
Date: Fri, 30 Jul 1999 19:07:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Hey, that's pretty neat!
Message-Id: <37a2f7b4.694691@news.skynet.be>
Tom Christiansen wrote:
> for (@translated = @original) { y/A-Z/a-z/ }
>
>But that's "wrong" you know.
>
>
> for (@translated = @original) { $_ = lc }
>
>is better.
Only if "use locale" is in effect. And even then, it might not make a
difference.
Bart.
------------------------------
Date: Fri, 30 Jul 1999 19:27:51 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Hey, that's pretty neat!
Message-Id: <X0no3.3281$nB.488902@news.itd.umich.edu>
In article <37a1d485@cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc,
> mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
>:If you've been programming in Perl for a while, you've probably needed to
>:use a construction like this:
>:@translated = map { (my $tmp = $_) =~ tr/A-Z/a-z/; $tmp } @original;
>God's teeth, man, no!
> for (@translated = @original) { y/A-Z/a-z/ }
>But that's "wrong" you know.
> for (@translated = @original) { $_ = lc }
>is better.
>You could also simple use
> @translated = map { lc } @original;
Oops! I oversimplified a bit too much in my original post. The code I was
actually twiddling when the shortcut I mentioned came to me involved
tr/A-Z /a-z_/, not just tr/A-Z/a-z/. I've always used something like
your last example to lowercase an array, but until now I hadn't thought
of anything shorter for more complicated cases.
--
Sean McAfee mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!
------------------------------
Date: 30 Jul 1999 13:32:15 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Hey, that's pretty neat!
Message-Id: <37a1fdbf@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
bart.lateur@skynet.be (Bart Lateur) writes:
:>But that's "wrong" you know.
:
:Only if "use locale" is in effect. And even then, it might not make a
:difference.
Why do you think I wrote the word in scare-quotes?
But I really hate y/A-Z/a-z/. I really really do. You can't
use it on English, let alone anything else.
Encyclophædia Britannica
El Niño
La Niña
Secretary Federico Peña
Molière
Renée
Goödel
Shröindger
coöperate
façade
fiancé
fiancée
naïve
preëmpt
rôle
tschüß
--tom
--
echo "I can't find the O_* constant definitions! You got problems."
--The Configure script from the perl distribution
------------------------------
Date: Fri, 30 Jul 1999 13:28:56 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: how good is fork() ?
Message-Id: <x3yu2qmhwrr.fsf@tigre.matrox.com>
ryanngi@hotmail.com (Ryan Ngi) writes:
> fork()
>
> i know how to implement it.....
you do?! Then what are you doing on this newsgroup? ;-)
Perhaps you meant "I know how to call it" ??
> but don't know how good it is...
It's very good.
> what situation lead us to use fork() ?
The most widely used use of fork() is in client-server applications
where a server sits and waits for clients to connect. Once a client
connects, the server forks a copy of itself that handles the
client's requests. Then the original server sits again and waits for
another client and so on.
Ala
------------------------------
Date: Fri, 30 Jul 1999 19:55:06 GMT
From: rurban@xarch.tu-graz.ac.at (Reini Urban)
Subject: How is perl braindamaged? (was Re: Is LISP dying?)
Message-Id: <37a20039.123452375@judy.x-ray.local>
if anyone is interested in "language wars" or let's say some arguments
from the outside morons, we collected some arguments on comp.lang.lisp
"why perl is braindamaged", "why python is better", "why perl is better
than python", why lisp is better than everything and such.
"Re: How is perl braindamaged? (was Re: Is LISP dying?)"
<wkwvvlp6i4.fsf@ifi.uio.no>
just to repeat myself here, i started with this:
"i want to add my vote for perl's following contras (and a view pros):
* forces unreadability (obscurity) in optimizations
(e.g. "schwartzian transform")
http://www.perl.com/CPAN/doc/manual/html/pod/perldsc.html
or http://www.perl.com/CPAN/doc/manual/html/pod/perllol.html
though this is nice for c kinda folks to make them feel brave
and clever, which is an important positive motivation, it makes it
impossible to maintain and it doesn't scale.
* arrays can hold only scalars, so you have to use references and
anonymous arrays, hashes.
* references have a impossible to learn/keep syntax.
i still don't know how to dereference right.
so complex data structures are not only hard to build,
remembering the syntax for "(" "[" or "{" initializers,
they are also hard to read.
* the object system feels like a hack or later addon.
i almost looks like a microsoft language.
the syntax is unreadable, a macro system is really missing
here.
(note added later: a macro system wouldn't help anything. this was to
lisp centric. the problem is elsewhere.)
* the module system is overly complicated. people should be forced to
write modules but only 2% (the top guns) actually do.
but on the other hand it has some nice lisp'ish features which made me
fall in love with perl. eval, closures, slices, world's best regex,
hashes, fast string processing, multiple namespaces per variable, easy
FFI, automatic type coercion, which could remind one to the broken
coercions in visual basic, but perl's is really okay.
there's even a perl lisp module which can read and eval (interpret) gnus
emacs files.
documentation is excellent."
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: Fri, 30 Jul 1999 15:25:31 -0400
From: brian@pm.org (brian d foy)
Subject: Re: How to count clicks to HTML link.
Message-Id: <brian-ya02408000R3007991525310001@news.panix.com>
In article <37a1cddc.2201498@nntp.netcomuk.co.uk>, wraygreen@hotmail.com (Ray Green) posted:
> gbacon@itsc.uah.edu (Greg Bacon) wrote:
> >Your design is broken. Counting HTTP accesses is impossible. Give
> >it up.
counting HTTP accesses is a fundamental feature of a server. if the
server is hit, it's logged.
> Proxies or no proxies, please explain why this wouldn't work.
it does work. the problem is that it counts the number of times
that your server has to serve the page, which is not the number of
times that the page was viewd. some people get that confused.
whether or not your design is broken depends on what you are trying
to count.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Fri, 30 Jul 1999 15:30:45 -0400
From: brian@pm.org (brian d foy)
Subject: Re: How to read the submit button as a name or value
Message-Id: <brian-ya02408000R3007991530450001@news.panix.com>
In article <37a1f44a@cs.colorado.edu>, tchrist@mox.perl.com (Tom Christiansen) posted:
> [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
> Floyd Morrissette <Webdesigner@NewWebSite.com> writes:
> :I have a question. Its seems to me that it would be better, if all you
> :want to do is read and parse, to cut and paste the ReadParse sub from
> :CGI.pm to the script where you want to use it. That way the server does
> :not have to read and compile and execute the entire 200k+ CGI.pm module.
>
> % time perl -MCGI -e 1
> 0.062u 0.009s 0:00.08 36.8%
>
> Don't blink. You'll miss it.
however, if all you want to do is the parse the CGI input, i recommend
use CGI::Request;
it's a CGI module without the cruft.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Fri, 30 Jul 1999 15:34:35 -0400
From: Floyd Morrissette <Floyd@NewWebSite.com>
Subject: Re: How to read the submit button as a name or value
Message-Id: <37A1FE4B.1056CE82@NewWebSite.com>
Tom Christiansen wrote:
>
> [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
> Floyd Morrissette <Webdesigner@NewWebSite.com> writes:
> :I have a question. Its seems to me that it would be better, if all you
> :want to do is read and parse, to cut and paste the ReadParse sub from
> :CGI.pm to the script where you want to use it. That way the server does
> :not have to read and compile and execute the entire 200k+ CGI.pm module.
>
> % time perl -MCGI -e 1
> 0.062u 0.009s 0:00.08 36.8%
>
> Don't blink. You'll miss it.
Point well taken. I only got the idea from reading Learning Perl which you
co-wrote with Randal. On page 4 it says, "This compilation does take time; it's
inefficient to have a voluminous Perl program that does one small quick task
(out of many potential tasks) and then exits, because the run-time for the
program will be dwarfed by the compile-time." So if this quote does not apply to
CGI.pm, what size program would it refer to? At what point does it become
inefficient? Don't think I am trying to be argumentative. I really do want the
answer because I have written some scripts where I was afraid it might be taking
too long to execute.
Thanks, Floyd
------------------------------
Date: Fri, 30 Jul 1999 14:06:40 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Newbie alert !!
Message-Id: <x3ypv1ahv0v.fsf@tigre.matrox.com>
Eric The Read <emschwar@rmi.net> writes:
> I'd say something like:
>
> perl -lni.bak -e "print $_,"|||||\n"' old_data_file
The '-l' adds a "\n" to your print()s. $_ already has a "\n" at the
end. You print a "\n" after the five pipes.
Too many \n's.
------------------------------
Date: Fri, 30 Jul 1999 14:02:03 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: passing a list of hashes to a subroutine?
Message-Id: <x3yr9lqhv8l.fsf@tigre.matrox.com>
iowa_song8@hot8mail.com (Weston Cann) writes:
> The problem is, I have no idea how to pass a list of hashes
> INTO a subroutine. I poked around Tom Christiansen's Perl Data
> Structures Cookbook, a reference book or two, and these
> newsgroups, but the closest things I've seen are instructions
> on how to pass a list or a hash into a subroutine - no lists of
> hashes.
Hmm... by list of hashes you mean an array of hashes?
@LoH = (\%h1, \%h2, \%h3);
some_sub(\@LoH);
sub some_sub {
my $HRef1 = shift;
my $HRef2 = shift;
my $HRef3 = shift;
..........
}
Or do you mean a sequence of hashes?
some_sub(\%h1, \%h2, \%h3);
sub some_sub {
my $HRef1 = shift;
my $HRef2 = shift;
my $HRef3 = shift;
..........
}
What exactly do you want to do?
Ala
------------------------------
Date: Thu, 29 Jul 1999 21:13:15 +0200
From: "Dr. Who" <qwerty@post.utfors.se>
Subject: Re: perl IP to OS mapping help
Message-Id: <37A0A7CA.AED5A0DE@post.utfors.se>
use Nmap;
----8<----
ffr200 wrote:
> hello,
> I need to write a perl program that receives an IP address and a
> hostname, and is able to return an operating system and OS
> information. Does anyone know how to get an OS from a given IP? Help
> is greatly appreciated.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: 30 Jul 1999 19:01:12 GMT
From: tcsh@holly.colostate.edu (Mike G.)
Subject: Re: qc check on dir
Message-Id: <slrn7q3tjo.34lm.tcsh@yuma.ACNS.ColoState.EDU>
tom.kralidis@ccrs.nrcanDOTgc.ca (Tom Kralidis):
> What's the best way to check if a directory exists?
I'd have to say if (-d "$dir") { ... }
this of course is well documented in man perlfunc
> Also, is there anything more native to Perl than using a system move
> command? I have looked high and low, but no luck.
How about the rename function? Also in man perlfunc.
>
> Any advice is appreciated. Please email reply also (change dot to .) if
> possible.
>
> Thanks alot
>
> ..Tom
------------------------------
Date: Fri, 30 Jul 1999 19:20:23 GMT
From: inlandpac@my-deja.com
Subject: Re: remove records from database
Message-Id: <7nstta$t9o$1@nnrp1.deja.com>
Point well taken and I apologize.
Thanks.
.......
open(SORT, "<$rawfile");
open(FINAL, ">$finalraw");
while(<SORT>) {
split /\|/;
$h{$_[2]}=$_ if $_[1]>$h{$_[2]};
}
for(keys %h) {
print FINAL "$h{$_}";
}
.......
This works perfectly and is very fast.
Chad.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 30 Jul 1999 19:48:55 GMT
From: twarren10@aol.com (Twarren10)
Subject: Re: remove records from database
Message-Id: <19990730154855.02198.00004387@ng-ft1.aol.com>
>
>Point well taken and I apologize.
>Thanks.
>
>.......
>open(SORT, "<$rawfile");
>open(FINAL, ">$finalraw");
>while(<SORT>) {
..like a breath of fresh air!
------------------------------
Date: Fri, 30 Jul 1999 19:23:43 GMT
From: olumsbaba@my-deja.com
Subject: running programs from inside perl
Message-Id: <7nsu3h$tba$1@nnrp1.deja.com>
HELP:
how do I call another program from inside Perl
e.g
I have a perl script but inside it I want to run a
java program [say, java test (where test.class is
the java class name)]
P.S I am on a UNIX system
marky
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 30 Jul 1999 19:07:58 GMT
From: "William" <bivey@teamdev.com>
Subject: Re: system function broken - ActivePerl - build 517 or 518
Message-Id: <01bedabe$ee4b3460$583c08cf@bill.jump.net>
Michael Allan <mike@zelea.com> wrote in article
<MPG.120ad29146467ca598968e@news1.on.sympatico.ca>...
> Request for confirmation of bug in build 517 or 518 of ActivePerl for
> Win32:
>
> Applications fail to launch properly from a system function call under
> build 518. For example, the following simple program, which worked in
> build 516, is broken under 518.
>
> use diagnostics;
> use strict;
> print system 'CALC.EXE';
> print $!;
Try using this syntax and see if it helps:
print system '"CALC.EXE"';
I posted twice a while back about a similar problem (using
backticks) and no one answered. However, when another
programmer at work mentioned long directory names it occurred
to me that my path did indeed contain non-8.3 directory
names. Putting the double quotes around the command (only,
leave the arguments out) fixes (works around) the problem.
(It's semi-consistant with the current version of DOS's
syntax for unusual pathnames - although you normally only
need it for embedding spaces.) -Wm
------------------------------
Date: Fri, 30 Jul 1999 13:33:23 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: when writing to data file, last letter is missing
Message-Id: <x3yso66hwkd.fsf@tigre.matrox.com>
vmacri@my-deja.com writes:
> I am totally lost, can anyone help....Please!!!
Show us some code and someone will surely point out your mistake.
Ala
------------------------------
Date: Fri, 30 Jul 1999 12:29:00 -0700
From: Hal Mounce <hal_mounce@amdahl.com>
Subject: Re: when writing to data file, last letter is missing
Message-Id: <37A1FCFC.E66985CA@amdahl.com>
vmacri@my-deja.com wrote:
>
> This may be a little vague but,
Well, yeah, sorta.
> My
> problem is that everything is written to that file correctly except the
> email address. The last letter of that field is always missing.
My swag is that someone used chop where they meant chomp. Look for the
words chop and chomp in the script and see if there's a chop near
something that fiddles with your email address.
perldoc -f chomp may yield additional clues.
Hal
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 315
*************************************