[9779] in Perl-Users-Digest
Perl-Users Digest, Issue: 3372 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 6 02:06:32 1998
Date: Wed, 5 Aug 98 23:00:20 -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 Wed, 5 Aug 1998 Volume: 8 Number: 3372
Today's topics:
Re: <SELECT multiple...> only returns 1st value <tchrist@mox.perl.com>
Re: Argh! (Nem W Schlecht)
But what about "baz"? (Was: "foo" and "bar") (Jon Bell)
Can I compile a perl script in Perl for Win32? ccalam@my-dejanews.com
Re: comp.lang.perl.announce redux (Frank)
Re: Does anybody have a BANNER AD program? (Martien Verbruggen)
Executing a Perl script from a hyperlink <rickryan@mindspring.com>
Re: hiding user input <rra@stanford.edu>
Re: Long Server side Process from CGI <AHands@sprynet.com>
Re: perl and sendmail <AHands@sprynet.com>
Re: perl and sendmail (Jon Bell)
Re: Perl Docs.. forget the original post <metcher@spider.herston.uq.edu.au>
Re: Perl guru FAR *PLEASE MAKE SURE YOU READ* <mpersico@erols.com>
Re: perl5 bug? Thanks <dan@dont.spam.me.please.missionrec.com>
Re: perl5 bug? <dan@dont.spam.me.please.missionrec.com>
Premature end of script headers & Exec format error <fairbrothers@smart.net>
Q: how to contorl timeout in msql.perl package? <jingang@cyberway.com.sg>
Q:How to compile a perl script under PerlW32? (LAM Yee-fai ALEX)
Re: rename problem (Mike Stok)
Re: response.pm (M.J.T. Guy)
Re: Retrieving file from REMOTE_ADDR ... HELP! (Hector Catre)
Re: Setting $ENV{LD_LIBRARY_PATH} doesn't work <mpersico@erols.com>
Re: setting a password on a linux system via cgi..... <BobnNOSPAM@NOSPAMinteraccess.com>
Re: stuck: variable replacement within backquote escape <AHands@sprynet.com>
Re: system( ) commands in CGI script <mpersico@erols.com>
Re: Teaching Perl <mpersico@erols.com>
Re: Teaching Perl <dgris@rand.dimensional.com>
Re: Teaching Perl <dgris@rand.dimensional.com>
Re: Web mail script (question for endymion) (Please Reply to Newsgroup)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Aug 1998 00:58:21 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: <SELECT multiple...> only returns 1st value
Message-Id: <6qav3d$16b$1@csnews.cs.colorado.edu>
In comp.lang.perl.misc, someone wrote:
:EEk!!!!
:
:Everyone yells about using CGI.pm. People overcomplicate things and force
:the rest of us to be lazy. It's wonderful to NOT reinvent the wheel. Then
:again, if you don't even know the basics of wheel-ism, you're not gonna
:learn much.
Guess what? Your code is wrong. Better go study CGI.pm some more.
--tom
--
You want it in one line? Does it have to fit in 80 columns? :-)
--Larry Wall in <7349@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 5 Aug 1998 22:18:57 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: Argh!
Message-Id: <6qb7b1$sej@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Craig Berry <cberry@cinenet.net> wrote:
>Nem W Schlecht (nem@abattoir.cc.ndsu.nodak.edu) wrote:
>: >@what = <A>;
>:
>: This is a bad way of reading in a file. Largish files will take a long
>: time and large amount of memory to load like this. The following is much
>: nicer on the system, while doing the exact same thing:
>:
>: push(@what, $_) while (<A>);
>
>First, that can be simplified to
>
> push @what, $_ while <A>;
You're not simplifying, you're removing parens that provide important
visual clues as to what's going on. Your version is much less readable,
IMO. I've noticed an increase in posted code without parens. Did
everybody have a breakdown with Lisp?
>Second, how is that better? Seems that @what will still end up requiring
>the same amount of memory in either case, and that the overhead for
>explicitly pushing each line will be larger than the overhead of doing a
>list-context <>. I'd Benchmark this, but can't work out a good way to set
>up the test.
Perl is, IMO, the coolest language on the earth. However, that doesn't
mean that it's perfect. Is using the code I provided the best way of
reading in a file? Nope. It is the one I prefer because it is a happy
medium between functionality and easy coding. I do have an IO test script
that I gleamed from several posts some time ago. I ran it using a file I
created by 'cat'ing /usr/dict/words five times, just to get a big file. On
my machine, the file was 16.2 Mb. Not a huge file, considering some of the
other files and databases I work with. I used the script included on the
bottom of this post, and ran it for all four tests. It uses Time::HiRes to
measure the execute time. It also does a quick 'ps' to see how much memory
it is using. (My machine: 128Mb RAM, 261 Mb swap, using perl5.005).
$ ./testio.pl test1
22704 /local/bin/perl ./testio.pl test1
Time: 3.4945
$ ./testio.pl test2
22688 /local/bin/perl ./testio.pl test2
Time: 0.7736
$ ./testio.pl test3
87288 /local/bin/perl ./testio.pl test3
Time: 52.0067
$ ./testio.pl test4
136456 /local/bin/perl ./testio.pl test4
Time: 148.8847
test3 is using the push() method. test4 is simply using the @ary = <FH>.
Now, I will grant that the push() method is *slower* for smaller files.
But for larger ones, as you can see, it is 3 times faster (both tests 3 & 4
caused my machine to swap). If we are in need of *really* fast input, we
can use a read() like in test2 and get our program in memory in less than a
second, but then we have to coerce it into an array ourselves (tests 1 & 2
don't do this).
#!/local/bin/perl
#
# Test multiple IO routines
#
# File: testio.pl
#
# Author: Nem W Schlecht
# Last Modification: $Date$
#
# $Id$
# $Log$
#
use Time::HiRes;
$file = "/home/nem/bigfile";
my($now) = Time::HiRes::time;
&{$ARGV[0]};
my($diff) = Time::HiRes::time - $now;
printf "Time: %.4f\n\n", $diff;
sub test1 {
open(IN, "$file");
undef $/;
$words=<IN>;
close(IN);
$/ = "\n";
system("ps -o vsz,args | grep [p]erl");
}
sub test2 {
open(IN, "$file");
read(IN, $words, (-s ("$file")));
close(IN);
system("ps -o vsz,args | grep [p]erl");
}
sub test3 {
open(IN, "$file");
push(@words, $_) while (<IN>);
close(IN);
system("ps -o vsz,args | grep [p]erl");
}
sub test4 {
open(IN, "$file");
@words=<IN>;
close(IN);
system("ps -o vsz,args | grep [p]erl");
}
__END__
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
"Perl did the magic. I just waved the wand."
------------------------------
Date: Thu, 6 Aug 1998 03:01:30 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: But what about "baz"? (Was: "foo" and "bar")
Message-Id: <Ex8z2I.AKC@presby.edu>
In article <fl_aggie-0508980953070001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <6q8sgb$dl$1@nswpull.telstra.net>, "Kim Saunders"
><kims@tip.net.au> wrote:
>
>+ Why are "foo" and "bar" ALWAYS used as example names in anything unix
>+ related, and partularly perl?
>
>Go see "Saving Private Ryan" when it comes your way.
I've probably seen the "foobar" etymology as often as anyone else in this
group, I guess, but I still don't know where "baz" came from. You don't
see "baz" as often as "foo" and "bar", but it occurs often enough in
connection with the other two that there must be a story behind it.
--
Jon Bell <jtbell@presby.edu>
------------------------------
Date: Thu, 06 Aug 1998 02:45:50 GMT
From: ccalam@my-dejanews.com
Subject: Can I compile a perl script in Perl for Win32?
Message-Id: <6qb5cu$49u$1@nnrp1.dejanews.com>
Hello All,
I want to compile a perl script into native image(EXE)
which can than be executed under WIN95/WINNT system.
Question:
1) Can I compile a perl script by Perl for WIN32?
2) IF YES, what is the procedure to compiler the Perl Script?
Thanks in Advance for any advise!
Best Regards,
Alex
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 06 Aug 1998 07:36:56 +0200
From: dont_use_this_ey@hotmail.com (Frank)
Subject: Re: comp.lang.perl.announce redux
Message-Id: <yo9iuk67jt3.fsf@nym.sc.philips.com>
"F.Quednau" <quednauf@nortel.co.uk> writes:
>
> Zu Geil, um wahr zu sein :-))
Es ist wahr! http://www.shuttle.de/schweikh/schwob
viel Spass beim schwaebeln!
Frank
------------------------------
Date: 6 Aug 1998 05:02:25 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Does anybody have a BANNER AD program?
Message-Id: <6qbdd1$p5l$1@nswpull.telstra.net>
In article <6q71kj$5ua$1@samsara0.mindspring.com>,
"Rick Ryan" <rickryan@mindspring.com> writes:
> Can I use Perl to create a rotating banner ad? Does anyone have any code
> they could send? Thanks
If you are interested in programs (possibly written in perl) and not
in the programming language Perl, you should most likely not be asking
this question here. This group doesn't discuss programs written in
perl, normally.
For your specific request, you should probably try
http://www.cgi-resources.com/
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Wed, 5 Aug 1998 23:05:56 -0500
From: "Rick Ryan" <rickryan@mindspring.com>
Subject: Executing a Perl script from a hyperlink
Message-Id: <6qba0v$n9l$1@camel25.mindspring.com>
I have a page that has an <img=> command that points back to a gif file. Is
there any way to make it point to and execute a perl script (without a
submit form)?
Thanks, oh gurus of the Perl!
rickryan@mindspring.com
------------------------------
Date: 05 Aug 1998 22:46:58 -0700
From: Russ Allbery <rra@stanford.edu>
To: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: hiding user input
Message-Id: <m367g6slv1.fsf@windlord.Stanford.EDU>
[ Posted and mailed. ]
Daniel Grisinger <dgris@rand.dimensional.com> writes:
> [posted to comp.lang.perl.misc but not mailed to the cited author]
> (funny what happens when one is polite and reasonable with their
> requests)
Ditto. :)
> Russ Allbery <rra@stanford.edu> wrote:
>> Er.
>> This is Usenet. Usenet has a lot of things, but historical record
>> ain't one of them.
> Perhaps that was true before a DejaNews url was an acceptable citation
> in papers and reports.
Um.
Where *do* you write papers and reports? I'd certainly never accept a
DejaNews URL as a legitimate cite. For one thing, unless they've recently
changed that, the URLs expire on a relatively fast basis. For another,
DejaNews is hardly comprehensive; like every other news server on the net
they miss and drop posts. Not to mention that a *lot* of people use
X-No-Archive.
> Perhaps that was true before business and personal relationships
> conducted entirely electronically were a normal thing for a large number
> of people.
Even *given* this, just blindly looking at posting history is stupid. I
mean, do you honestly think that my posts to alt.irc have anything to do
with how good of Perl code I write? This is particularly misleading if
you have no idea of the prevailing culture on alt.irc, which is slightly
warmer than alt.flame.
What about the fact that people routinely post to Usenet under several
different e-mail addresses? I use two actively myself, and have five
others with a non-trivial number of archived posts.
What about the fact that newsgroups are social environments with a very
different method of problem resolution than one normally finds in person?
I'll wager that nearly *everyone* who has been on Usenet for a nontrivial
amount of time has gotten involved in at least one ill-conceived flamewar
and has posted at least one post that they wish they'd never made.
> Perhaps that was true before the volume of Usenet was so great that one
> couldn't keep up.
Usenet is *less* of a historical record because of this. Usenet is a
*dynamic* medium, and it's not one into which people invest great
quantities of time and restraint. That may not always be the best thing
for Usenet and the quality of discussion, but it's undeniably true.
> This argument is completely invalid. As long as the backbone providers
> are for-profit organizations, as long as ISPs are selling service to
> people whose sole reason for Internet access is Usenet, as long as their
> are people writing books and for-pay articles based on research
> conducted in Usenet _somebody_ is making money off of your writings
> without your explicit permission. DejaNews is just easier to spot at it
> than the others are.
John Stanley has already posted a fairly good rebuttal of this.
>> I personally consider this concept of determining who someone is from
>> their posting profile to be a Very Bad Thing.
> Pardon me?
> I personally consider determining who someone is from their words and
> actions to be a Very Bad Thing. How's that again?
I personally consider determining who someone is from *an incompletely
record of* their words and actions *taken totally out of context* to be a
Very Bad Thing.
You do not know the prevailing culture of the groups to which I post, you
don't have the background to evaluate how my archived posts fit into
larger threads, you do not have easy access in DejaNews to the information
that I cancelled the post five minutes later or posted an apology or that
I was going through some personal crisis at the time, and you have no idea
how what I do *for recreation* (Usenet is *recreation* for nearly everyone
here, even in technical groups) resembles how I behave in other
situations.
> Perhaps it is a generational thing, I don't know. But I consider the
> fact that DejaNews provides an accurate historical record that will be
> usable indefinitely to be a much better thing than the previous
> transitory nature of the medium.
But it *doesn't* do that, because people *do* use X-No-Archive. In fact,
after this thread, I'm very tempted to start using it myself, just to
further reduce the usefulness of this so-called "historical record" for
people who want to use it for the purposes that you're alluding to.
DejaNews is a useful search engine for a variety of accumulated
information that I've successfully used to find answers to technical
problems and to follow posts made by people I enjoy reading to groups I
don't read. It's also a very valuable resource for finding groups on a
particular subject and for researching old issues when they come up
again. But it's *not* all the things you're trying to make it into; it is
*not* the Congressional Record of Usenet, and I dearly hope that such a
thing will never exist.
> I just can't stand to see information thrown away when we don't know yet
> if that information will be useful later.
If you were talking about technical information or the like, I could agree
with this, but you're talking about personal information about the
behavior of individuals, and the concept of preserving that information
forever is absolute ANETHEMA to me. Not even *bankruptcy* information is
preserved indefinitely. Please allow people to let their past rest in
peace once in a while. We all grow and change as humans, and sometimes
past mistakes *are* best forgotten.
> It does matter if a person has been a jerk continuously for ten years,
> in multiple forums, with no provocation. But by not maintaining a
> record we can't track that.
Why? Why do you care? Why does anything beyond "he's being a jerk now"
versus "he's not being a jerk now" matter to you? Are you honestly going
to evaluate every piece of information you receive on the basis of who
gives you that piece of information and whether they kicked kitty-cats six
months ago?
It's honestly *not that hard* to tell when someone is being unproductive
and contributing nothing and deserves to be ignored. It's faster to
determine it on the spot than it is to do a DejaNews search, for heaven's
sake.
> But I don't think that it is network abuse. I personally feel, very
> strongly, that the no archive header _is_ abuse. I think that it is a
> disgusting, spineless, cowardly attempt to avoid responsibility for
> one's own actions.
DejaNews does not have an unlimited right to do whatever they wish with my
posts. Full stop. I am quite certain that I could establish that in a
court of law if I so chose.
> I have to admit that the presence of that header is enough to make me
> leery of trusting even someone who has proven that they are serious. I
> just can't help but wonder what it is that they are trying to hide that
> they won't allow their words to stand.
Then killfile X-No-Archive and be done with it. Why impose this personal
belief on the rest of Usenet? Some of the most valuable contributors to
many groups that I read use X-No-Archive routinely because they dislike
DejaNews's policy and that is their *right*.
> - This is very much off topic for clpm, but I'm not sure what forum
> would be more appropriate. It would be appreciated if someone could set
> followups appropriately.
There unfortunately isn't a very good one. news.admin.net-abuse.policy
isn't a bad one, but this is abuse *on* rather than *of* the net and it's
therefore technically off-topic. news.admin.misc is a maybe, but it's
iffy.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Wed, 05 Aug 1998 22:40:39 -0400
From: Adrian Hands <AHands@sprynet.com>
Subject: Re: Long Server side Process from CGI
Message-Id: <35C917A7.D261FCB4@sprynet.com>
Yes: fork.
You might want to return the child's PID to the user and give them a cgi
form to kill it later, or check it's status.
Julian Houlding wrote:
>
> Hi,
>
> I need to start a server side process from a Perl CGI script which will
> continue running on the server even after the CGI script has returned.
>
> Any ideas?
>
> Thx.
--
Adrian Hands
Raleigh, NC
panic: attempt to recv circular datagram in round socket!
panic: stack pointer is read-only!
$
------------------------------
Date: Wed, 05 Aug 1998 22:56:14 -0400
From: Adrian Hands <AHands@sprynet.com>
To: Steve Goodyear <sgoodyear@genxsys.com>
Subject: Re: perl and sendmail
Message-Id: <35C91B4E.A33618B6@sprynet.com>
procmail
Steve Goodyear wrote:
>
> how do I pass an email message to perl for parsing?
> I realize I can alias a program in the aliases file, but i'm not sure how it
> passed the message to a program.
--
Adrian Hands
Raleigh, NC
panic: attempt to recv circular datagram in round socket!
panic: stack pointer is read-only!
$
------------------------------
Date: Thu, 6 Aug 1998 03:10:41 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: perl and sendmail
Message-Id: <Ex8zHu.B7v@presby.edu>
In article <35c8bc67.0@news.destek.net>,
Steve Goodyear <sgoodyear@genxsys.com> wrote:
>how do I pass an email message to perl for parsing?
>I realize I can alias a program in the aliases file, but i'm not sure how it
>passed the message to a program.
Under Unix at least, if a mail alias is a "pipe" to program (e.g. your
Perl script), the message appears on the program's standard input. So
read the message from STDIN using any of the usual methods.
--
Jon Bell <jtbell@presby.edu>
------------------------------
Date: Thu, 06 Aug 1998 13:31:14 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Perl Docs.. forget the original post
Message-Id: <35C92381.11801B20@spider.herston.uq.edu.au>
Charles Maier wrote:
>
<snip>
> Sending <people> to the FAQ is a good idea... if only to inform them of
> the resource. BUT... the FAQ is only really useful for "reading
> material".. not research. Before I get flamed.. SURE you can search
> it... but you gotta "know the question".
>
<snip>
Maybe it's something in the culture. I've just spent a week with the
Linux docs, and I've come up with this rule of thumb - you must *read*
(not just scan) *every* piece of documentation on <insert task here> you
can find *before* you start <task>. That's just the way it is. Of
course, that's what the perl gurus have been saying all along. It's
difficult to hear coming from a different culture, but that doesn't make
it wrong.
It helps to understand that the people that write this documentation are
*NOT* writing it for: quick gratification; casual users; ease of use;
shallow understanding. Essentially, they are writing it for themselves
and people like them, as a way to express and share the depth and
breadth of their knowledge. They don't have "useability" departments
doing random tests on Joe Average to see if he understands. They don't
care about that and there's no reason why they should. (Anybody who
feels unfairly, inaccurately or inappropiately spoken for, direct flames
to usual...).
--
Jaime Metcher
------------------------------
Date: Wed, 05 Aug 1998 23:23:37 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Perl guru FAR *PLEASE MAKE SURE YOU READ*
Message-Id: <35C921B9.119D59A7@erols.com>
Hmm. A nip here and tuck there and I think you have a submission for
TPJ.
What, you don't know from TPJ?
http://www.tpj.com
BTW, don't mistakenly type http://www.tjp.com
You get that stooooopid cyber-baby dancing all over your bandwitdh.
--
Matthew O. Persico
mpersico@erols.com
Bill should be just as scared of Perl/Tk
as he should be of Linux!
------------------------------
Date: Thu, 06 Aug 1998 02:23:12 GMT
From: "Mission A/V" <dan@dont.spam.me.please.missionrec.com>
Subject: Re: perl5 bug? Thanks
Message-Id: <ks8y1.958$GM4.1905724@news2.atl.bellsouth.net>
Thanks very much to all that responded to my problem. The hash advice
did the trick well.
Daniel
>
------------------------------
Date: Thu, 06 Aug 1998 01:32:29 GMT
From: "Mission A/V" <dan@dont.spam.me.please.missionrec.com>
Subject: Re: perl5 bug?
Message-Id: <NI7y1.646$ke.1199350@news1.atl.bellsouth.net>
Mark-Jason Dominus wrote in message <6qaj7c$sta$1@monet.op.net>...
>You really need to get a book about Perl, and then yu need to read it.
At some point I will. Right now, I've just got to get acouple of scripts
running, that used to work under perl4.
Thanks for the advice.
Daniel
------------------------------
Date: Thu, 06 Aug 1998 12:55:58 -0400
From: Jim Fairbrother <fairbrothers@smart.net>
Subject: Premature end of script headers & Exec format error
Message-Id: <35C9E01E.A46536C5@smart.net>
Can anyone help me - I am getting errors on this code trying to put a
picture
in the HTML output from a Perl program on a Linux machine:
# Notify FairBrothers
$fairmail = 'fairbrothers@smart.net';
mailto $fairmail -s 'You have a new Order $TotalCost';
sub html_header {
$document_title = $_[0];
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>$document_title</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<HR>\n";
print "<IMG ALIGN=middle SRC="thankyou.gif">\n";
print "<HR>\n";
print "<H1>$document_title</H1>\n";
print "<P>\n";
}
I have tried every combination of ",' and no " or ', but they seem to
still give the same
error. I set the permissions to 777 on the gif file and if I change the
location, it gives me
a "can't find" error, so I think I have the directory/location okay.
The errors in the error log are:
Can't call method "mailto" in empty package "fairbrothers@smart.net"
at /home/fairbrothers/www/cgi-bin/verify.pl line 52.
exec of /home/fairbrothers/www/cgi-bin/thankyou.gif failed,
reason: Exec format error (errno = 8)
[Wed Aug 5 22:57:37 1998] access to
/home/fairbrothers/www/cgi-bin/thankyou.gif failed
for fairbrothers.smart.net, reason: Premature end of script headers
------------------------------
Date: Thu, 06 Aug 1998 11:22:14 +0800
From: Jin Gang <jingang@cyberway.com.sg>
Subject: Q: how to contorl timeout in msql.perl package?
Message-Id: <35C92166.81495187@cyberway.com.sg>
Hi,
How do i set timeout, so if msql server is not available, msql->connect
will return immediately?
thanks,
pls reply to me
Jin G
------------------------------
Date: 4 Aug 1998 13:43:31 GMT
From: ccalam@cpccux0.cityu.edu.hk (LAM Yee-fai ALEX)
Subject: Q:How to compile a perl script under PerlW32?
Message-Id: <6q7363$7o45@news1.cityu.edu.hk>
Hello All,
I read from newsgroup that the Perl 5.005_XX image can
compile a perl script into native image (EXE).
Question:
1) What are the steps taken in order to compile a perl script?
2) Is the procedure for compiling a perl script the same
across difference platform? (Solaris, HP, WIN32)
3) Is the compiled image be executed faster and takes less
resources? (memory, CPU, disk space)?
Thanks in advance for any suggestion!
Best Regards,
Alex
------------------------------
Date: 6 Aug 1998 01:14:57 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: rename problem
Message-Id: <6qb02h$dti@news-central.tiac.net>
In article <35C8D99C.F53671B9@richmd.demon.co.DELETE.uk>,
Peter Richmond <peter@richmd.demon.co.DELETE.uk> wrote:
>Hi,
>
>ive tried this
>
>rename $old, $new;
Have you tried something like
unless (rename $old, $new) {
die "$0: couldn't rename $old to $new ($!)\n";
}
to see what the OS reports as the error?
If you're hunting down errors then the -w flag is useful, if you're not
using it then you should try it.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 6 Aug 1998 01:43:39 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: response.pm
Message-Id: <6qb1ob$qcp$1@pegasus.csx.cam.ac.uk>
In article <6q7ocl$kg7$1@nnrp1.dejanews.com>, <brejen@intercall.com> wrote:
>I am getting an error regarding the lines:
>sub error_as_HTML
>{
> my $self = shift;
> my $msg = $self->{'_msg'} || 'Unknown';
> my $title = 'An Error Occurred';
>
>---------------------------
> my $code = $self->code;
>---------------------------
>
> return <<EOM;
>
>The message is "can't call method 'code' without a package
>or object reference. Please somebody give me a clue.
Hard to say from that incomplete information. But I'd guess that you
aren't using -w, and that if you did use it, you'd learn rather more.
What argument are you passing to the subroutine error_as_HTML() ?
Are you sure?
Mike Guy
------------------------------
Date: Thu, 06 Aug 1998 04:20:02 GMT
From: hector@followme.com (Hector Catre)
Subject: Re: Retrieving file from REMOTE_ADDR ... HELP!
Message-Id: <6qavtq$585$1@goblin.uunet.ca>
In article <Pine.GSO.4.02.9808051359250.14291-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> wrote:
>On Wed, 5 Aug 1998, Hector Catre wrote:
>
>> I have a website
>
>That's nice. :-)
>
>> I have a jpg that I want to upload to the server
>
>So far, so good.
>
>> I want the cgi to open up a directory listing of my (client side) computer,
>
>Maybe you want to write a CGI program to do that.
Gee, what do you think I'm doing here? I don't know how to do this! I still
need help.
>> then after I choose what that file is, the cgi-uploads it to the
>> server
>
>So, you want your program to let you choose a filename, then your remote
>user will upload it? Or will _you_ be the remote user? This isn't clear.
I want to write a Perl Cgi that helps me locate my file on my computer (client
side), and copies it to the server. The concept isn't difficult. Figuring out
how to do this is what I need help with.
>Of course, there's nothing Perl-specific about this. If your problem is
>with the CGI interface, perhaps the docs, FAQs, and newsgroups about the
>CGI interface and related topics would help you. Good luck!
Hmmmm ... I thought this was the Perl Misc. Newsgroup. This does go under
miscellaneous doesn't it? I want to write it in perl specifically. But, I
don't know how to use a server side Perl CGI to open up my remote side
directory structure, nevertheless, figure out how to copy it over ... again
.. in perl. If the file were local to the server then this wouldn't be a
problem. But it isn't, and that's where I have no idea of how to do this.
Again ... HELP!!!!!!!!!!!
Hector
------------------------------
Date: Wed, 05 Aug 1998 23:35:28 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Setting $ENV{LD_LIBRARY_PATH} doesn't work
Message-Id: <35C92480.463E9F40@erols.com>
Hmm. I was about to write the standard "Environment is shared downward
not upward" comment, but the presence of a BEGIN intrigues me.
As I understand it, the BEGIN blocks are executed once parsed, before
the rest of the script is executed. Kind of like:
parse a chunk
if BEGIN, exec it, next chunk
if no more chunks, exec unexecuted chunks.
Now, it would seem that as long as the call to Oracle is not made in the
BEGIN block, loading the .so would be delayed until the use DBD::Oracle
statement is encountered, at which time the envvar is indeed loaded.
However, I can think of two possibilities that explain the fact that it
doesn't work that way:
1) The use statements are parsed very early and any loading/binding
required is performed before BEGIN blocks.
2) (More likely) The envvar is defined in the envvar space of the
program, not the perl intepreter that has to go out and use it.
Am I warm?
--
Matthew O. Persico
mpersico@erols.com
Bill should be just as scared of Perl/Tk
as he should be of Linux!
------------------------------
Date: Wed, 05 Aug 1998 22:06:02 -0500
From: Bobn <BobnNOSPAM@NOSPAMinteraccess.com>
Subject: Re: setting a password on a linux system via cgi.....
Message-Id: <35C91D9A.6F0B@NOSPAMinteraccess.com>
My experience has been that 'passwd' is very stubborn about wanting the
passwords entered from a 'tty' (which is to say that redirecting input
to a file doesn't fly). My workaround has been to create a scipt which
prints the appropriate commands (repsonses) and does sleep 1;'s for
pauses and pipe it's to "telnet localhost". There's also a Telnet.pm
which appears to work OK.
Brad Jones wrote:
>
> Hello all, anyone have a suggestion as to how to allow a new user to create
> an account and change a password via a cgi script? I think I have the
> creating the user part taken care of but don't know how I can set the
> password for the account using passwd program......Any help is greatly
> appreciated......
>
> Brad
------------------------------
Date: Wed, 05 Aug 1998 22:53:28 -0400
From: Adrian Hands <AHands@sprynet.com>
To: "Fenwick, Wynn [FITZ:4C17:009]" <wynn@americasm01.nt.com>
Subject: Re: stuck: variable replacement within backquote escape?
Message-Id: <35C91AA8.3389738@sprynet.com>
Are you saying perl isn't evaluating the four $... before passing them
to the shell ?
That's not the behaviour I'm getting:
#!/usr/bin/perl -w
use strict;
my ($gzcat, $grep) = ('/bin/zcat', '/bin/grep');
my ($logfilename, $regexp) = ('passwd.gz', ':');
my $today= `$gzcat $logfilename | $grep -c -e '$regexp'`;
print "$today\n";
$ ./trash2.pl
22
$
Fenwick, Wynn [FITZ:4C17:009] wrote:
>
> Hello all,
>
> I'm stuck on trying to get a count of $regexp matches of a gzipped file
> without having to gunzip it and re-gzip it. I'd also like to make it
> flexible and have the paths to the programs flexible, as well as the
> regexp I'm searching on.
>
> this...
>
> $today= `$gzcat $logfilename | $grep -c $regexp`;
>
> ...does not work because the identifiers are sent to the shell that
> services the backquote expression instead of being replaced with values
> first. Is there a way to make them get replaced first before sending
> this command to the shell?
>
> --
> Wynn Fenwick |
> Nortel, Ottawa |
--
Adrian Hands
Raleigh, NC
panic: attempt to recv circular datagram in round socket!
panic: stack pointer is read-only!
$
------------------------------
Date: Wed, 05 Aug 1998 21:55:09 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: system( ) commands in CGI script
Message-Id: <35C90CFD.D98682C8@erols.com>
Scott Erickson wrote:
>
> Previously, Brian Day wrote:
>
> >Neither example works. If I use one system() call with one backslash call, it works but the system call returns an integer, and the backlsash call returns a string. The
> >comparison works then, but I don't think this is good practice.
>
> Odd.
>
No, not odd. You just have to take a closer look at the docs.
system returns the return value of whatever you stuff in it, more or
less. See 'perlfunc' or the camel bok for details.
backticks return you stdout, with $? as the status.
--
Matthew O. Persico
mpersico@erols.com
Bill should be just as scared of Perl/Tk
as he should be of Linux!
------------------------------
Date: Wed, 05 Aug 1998 23:38:17 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Teaching Perl
Message-Id: <35C92529.ED2CB168@erols.com>
I think the question begs:
Why? Does your boss expect the attendees to be able to use Perl at that
point? I hope not.
--
Matthew O. Persico
mpersico@erols.com
Bill should be just as scared of Perl/Tk
as he should be of Linux!
------------------------------
Date: Thu, 06 Aug 1998 04:49:20 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Teaching Perl
Message-Id: <6qbbrk$58c$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <35C90ECE.662@tidalwave.net>
palincss@tidalwave.net wrote:
>By leaving out regular expressions you have omitted what is probably
>its most powerful unique feature. Also - a beginning intro IMO
>doesn't need to get into references or what you describe as subroutine
>semantics.
Yes, I definitely need to cover at least the basics of regular
expressions :-). I also left out scoping and namespace issues
from my original list, but certainly need to teach scoping rules
if I have any hope of helping these guys learn perl.
Subroutine semantics may not be necessary, but I consider references
to be one of the fundamental aspects of the language. Without
a solid understanding of how perl manages references it is impossible
to effectively use perl's modular and object capabilities. Honestly,
with this particular audience (C/C++ programmers who won't be
intimidated by the concept of memory addresses), I'll skip teaching
regular expressions before I'll skip references.
<digression>
It absolutely amazes me that most books about perl present regular
expressions before references, especially considering the relative
difficulty level of concepts involved (references are simple,
regular expressions are not). I strongly consider a more than
passing familiarity with perl's reference semantics to be
a prerequisite for any serious development in perl.
</digression>
Thanks for your help.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Thu, 06 Aug 1998 05:00:45 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Teaching Perl
Message-Id: <6qbcj8$5a3$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <35C92529.ED2CB168@erols.com>
"Matthew O. Persico" <mpersico@erols.com> wrote:
>I think the question begs:
>
>Why? Does your boss expect the attendees to be able to use Perl at that
>point? I hope not.
She expects them to at least be able to puzzle their way through
my code while they get up to speed. I won't be expected to teach
them from everything, and they are experienced programmers, so
a one day overview seems like it should be sufficient to get them
started (well, maybe not, but it's all the time she's willing to
spare). They also won't be doing any heavy duty development (I hope),
just maintenance on the stuff that I'm writing.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Thu, 06 Aug 1998 06:19:53 GMT
From: reply@newsgroup.please (Please Reply to Newsgroup)
Subject: Re: Web mail script (question for endymion)
Message-Id: <35c9493d.13795331@enews.newsguy.com>
I have used Mail Man from endymion and like it. (I don't need the
filters, but sympathize with the original poster's problem.)
My question for Endymion is as follows:
I set up a free email account at usa.net (actually,
mail.netaddress.com) for a nonprofit group. That service allows mail
to be checked from the web or from any POP-capable software.
To avoid reading the banner ads at usa.net all the time, I suggested
the nonprofit group use Mail Man on my site to read the usa.net
account, but I get the error "too few top lines." (The script works
fine on other POP accounts, so it is apparently set up correctly.
Also, the username and password work fine on usa.net's web page, so I
know we're using the correct login.)
Is there something about endymion's Mail Man script that is not
compatible with some POP type systems? Any ideas about how to fix
this?
Thanks. Please reply to this newsgroup.
On Fri, 24 Jul 1998 00:08:52 GMT, endymion@my-dejanews.com wrote:
>In article <6p603t$nak@bgtnsc02.worldnet.att.net>,
> "Terry Cora" <TerryLCora@worldnet.att.net> wrote:
>>
>> I am looking for a web based e-mail script (ala hotmail) for a non profit
>> geographic spacific church directory site. Running a virtual server with a
>> "catch all" e-mail system. NetRoamer looks good, but they ignore my e-mails
>> and do not provide demo to see if it will work on my server. I installed
>> MailMan, but it will only check the "catch all" box.
>>
>> Has anyone modified MailMan to to filter incoming messages and sort them
>> into spacific user boxes with a web interface to allow new users to sign up?
>
>We are working on this exact modification as an extension of the
>Professional Edition of our MailMan product, as a means of providing
>a one-stop "Free Mail" software solution, among other things. Commercial
>licenses for the professional edition will be $400 per server for an
>unlimited number of users, and the as-of-yet unnamed one-stop free email
>system will run $500 per server. As a non-profit, this software would be
>free for you to use, just like the Standard Edition of MailMan currently
>is. We are working out our engineering schedule right now to try to
>determine a projected release date of this package, but our unofficial
>projected initial beta release date right now is August 31. Stop by
>our site over the next couple of weeks if you are still interested,
>http://www.endymion.com/products/mailman
>
>Ryan Alyn Porter, President
>Endymion Corporation
>http://www.endymion.com
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3372
**************************************