[9257] in Perl-Users-Digest
Perl-Users Digest, Issue: 2852 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 12 04:08:10 1998
Date: Fri, 12 Jun 98 01:00:43 -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 Fri, 12 Jun 1998 Volume: 8 Number: 2852
Today's topics:
Re: "no blank line" error from all WinPerl scripts (Dewey Williams)
Re: *Simple* MakeMaker question (John Siracusa)
Re: Certified Perl Programmers (Martien Verbruggen)
Re: Command line substitution thru subdirectories jimbo@soundiamges.co.uk
Re: Compile Perl5.4 on AIX 4.2 with Gcc 2.8.0 <PROCURA_BV@CompuServe.com>
Re: filehandles (Martien Verbruggen)
ftp'ing within a perl script <dhwright@mindspring.com>
Re: Have we got a good free Perl manual? (Todd Lehman)
hmmm, suggestions? <lordbyron@rapidnet.net.au>
Re: I want threads, threads and more threads! <dformosa@st.nepean.uws.edu.au>
Re: mailspinner.cgi <thoellri@tobias.corp.adobe.com>
Re: Newbie Net-DNS problems (Michael Fuhr)
Re: NNTP module <dformosa@st.nepean.uws.edu.au>
Re: pack/unpack seps <75762.2332@CompuServe.COM>
Perl NT IIS4.0 - can't get Perl to work via the web <ric@arborsites.com>
Re: Perl to newsgroups - how? <quentin@shaddam.amd.com>
Removing duplicates <michael@datahost.com>
Re: Removing duplicates (Matt Knecht)
Re: Removing duplicates <bowlin@sirius.com>
removing dups from a file <michael@datahost.com>
removing dups from files <michael@datahost.com>
Re: removing dups from files (Martien Verbruggen)
Re: reverse sorting <merlyn@stonehenge.com>
Re: reverse sorting (John Moreno)
Re: search problem in cgi script (Andre L.)
suggestions for improving efficiency ? (Mike Mckinney)
Re: Voting for the new, high-signal perl newsgroup <tchrist@mox.perl.com>
Re: Voting for the new, high-signal perl newsgroup (Ken Arromdee)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 11 Jun 1998 04:22:31 GMT
From: Dewey.Williams@mindspring.com (Dewey Williams)
Subject: Re: "no blank line" error from all WinPerl scripts
Message-Id: <357f59ac.15469225@news.mindspring.com>
On Wed, 10 Jun 1998 22:22:08 GMT, Gellyfish@btinternet.com (Jonathan
Stowe) wrote:
>On Wed, 10 Jun 1998 20:11:32 GMT, williams wrote :
>
>>All the WinPerl scripts I have tried give this error when I access
>>them with my browser (Netscape):
>>
>>Message: CGI output from D:/WebSite/cgi-shl/ filename
>>contained no blank line separating header and data (most
>>likely a broken CGI program)
>Yep those nice folk over at comp.infosystems.www.authoring.cgi
>probably have a very good FAQ they can point you to .
>
>A clue: \n\n
I have browsed this newsgroup some and have come to the conclusion
that many of the Perlites here are hostile, arrogant and downright
unhelpful to the new user trying to learn Perl.
This answer I received was uninformative, sconfusing (in that it
hinted the problem was not in my Perl script) and WRONG!
The error message I received from my browser is apparently a generic
one, indicating tht the Perl script is broken. After receiveing this
error continuously on various scripts I managed to run the same
scripts at the command line.
Behold! All the errors accompanying my script were revealed. Once
fixed, no more browser error, no more Perl error (at least not in this
instance).
Those of you that know Perl, please try to be a bit more forgiving
toward those of us that don't. We are all beginners in some
things.....
Dewey Williams
If you are not part of the solution....
You are part of the precipitate.
------------------------------
Date: 12 Jun 1998 03:51:20 GMT
From: macintsh@cs.bu.edu (John Siracusa)
Subject: Re: *Simple* MakeMaker question
Message-Id: <6lq8jo$r6b$1@news1.bu.edu>
Zenin (zenin@bawdycaste.org) wrote:
: h2xs -AX -n My::Module
: Always, always, always start with h2xs when creating
: new modules, even if you're not using any C.
Heh, I read
"even if you're not building around a header file, and even
if you don't have an XS component."
in the man page, but never made the leap from that to "even if
you're not using any C"! Just goes to show, if there's an
incorrect interpretation, someone will find it. Well, off I
go...thanks for setting me straight.
-----------------+----------------------------------------
John Siracusa | If you only have a hammer, you tend to
macintsh@bu.edu | see every problem as a nail. -- Maslow
------------------------------
Date: 12 Jun 1998 04:49:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Certified Perl Programmers
Message-Id: <6lqc19$aun$1@comdyn.comdyn.com.au>
In article <6lpk8h$k7v@enews3.newsguy.com>,
"Felix S. Gallo" <fsg@newsguy.com> writes:
> THE ONE TRUE CERTIFYING PERL AUTHORITY (tm) (c) (r)
It's Perl if you talk about the language, and perl if you mean the
program/interpreter.
There's no such thing as PERL in this group, and I don't care about
acronyms and the the rules they usually follow. I do care about
history.
<insert appropriate emoticon here>
Martien
PS. For those who don't get it, pity.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: 12 Jun 1998 08:02:49 +0100
From: jimbo@soundiamges.co.uk
Subject: Re: Command line substitution thru subdirectories
Message-Id: <u67i7xfty.fsf@JIMBOSNTSERVER.i-have-a-misconfigured-system-so-shoot-me>
Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc,
> dsdapc03@DSDAPC03.okladot.state.ok.us (OS2 User) writes:
> :A really _great_ way to attract business to a Perl consultancy.
> :Maybe you should go into advertising, too. And Human Relations
> :also might be a good choice.
>
> I prefer to be a real person with real opinions who doesn't lie just
> because it suits his pocket book and becomes a money-grubbing pig who
> changes his words into lies to try to get more people to kiss his behind
> and ante up. I won't do that. I do Perl because it's fun, not because
> I want to become the next billgatesionaire. If you can't take the heat,
> get out of the kitchen.
Tom, what's the particular issue with money? What's the particular
issue with Bill Gates? Do you honestly think that Bill is any less
motivated by the same convictions that you are? The reference points
may be at radically different positions in the sphere of human
endeavor, but that does not diminish the passion or strength of
feeling in any way. You and Bill and, dare I mention it, RMS, seem to
share many qualities. Strength of conviction. Unbending opinion. Drive
and motivation to keep to the one true path.
Being a real person with real opinions is a laudable ambition. Being
truthful, for any reason, including the pocketbook option, ought to be
a keystone of human behaviour and interpersonal relations. Being
polite, civil, decent and willing to accept the diversity of thought
and deed that combine to make up the experience of living and life are
also as important.
Ask Bill. He does it because it's fun. He belives in his mission. He
has the same zealous passion that many of us have about all manner of
things. Seems a fairly normal human being.
For the record, Bill has never said to me, and I doubt he's said to
you: Kiss my behind. Ante up. But maybe I missed that event?
Do you think that it is wrong to earn money, of any sum, from
promoting your company and products and philosophies in the commercial
arena? Why do you think Bill in money grubbing? He has certainly
created a vast personal and corporate fortune. Perhaps far more than
anyone person would ever need to live a comfortable and secure
life. But to say he's money grubbing may not be seeing the whole
picture. May even indicate an unwillingness to see the whole picture.
In the end, maybe I will vote for a moderated group. That way, the
*nix constituency will move wholesale there and the remaining members
of the misc group will comprise mainly the dreaded dregs: Prisoners of
Bill. This may obviate the need for a seperate Win32 Perl group. Sad,
really. But then, peace can often only be enforced by a DMZ. Witness
Korea.
Jim Brewer
------------------------------
Date: Tue, 09 Jun 1998 14:35:00 +0200
From: "H.Merijn Brand" <PROCURA_BV@CompuServe.com>
Subject: Re: Compile Perl5.4 on AIX 4.2 with Gcc 2.8.0
Message-Id: <357D2BF4.4FE0813@CompuServe.com>
I got it running perfectly with AIX's cc, could send you my "perl -V"
if you like.
zhang yao wrote:
>
> If you are refering perl v5.00404, yes. I compiled it using gcc2.8.0 on aix
> v4.2.1.0
> I could email you the perl -V result if that is what you want
Yes, please!
Got the same problems you described with gcc 2.8.1, so I'm very
interested in your gcc version of `perl -V`
thnx
------------------------------
Date: 12 Jun 1998 02:51:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: filehandles
Message-Id: <6lq52t$a93$1@comdyn.comdyn.com.au>
In article <358045F1.FCCAD5B2@retina.net>,
Wirehead <allen@retina.net> writes:
> I don't have much experience in perl. Is there an easier way to do this?
Easier, and much safer.
> #!/usr/local/bin/perl5
It is advisable to use the -w flag to perl. It will make your life a
lot easier.
It is also a good idea to use strict. it enforces some good
programming practices.
> print "Please enter the subnet in which you would like to scan:\n";
> chomp($_=<STDIN>);
> open(FINDIT, "grep $_ /etc/hosts |");
Passing user input to a shell command without checking what it is is a
bad idea. What happens if someone (accidentally of course) types in
; rm -rf /;
at the prompt? (Please don't try it)
You should also check the return value of the open.
> open(FINDOUT, ">temp1");
As well as above, it is a good idea to check the return value of a
system call here.
open(FINDOUT, ">temp1") || die "Cannot open temp1 for writing: $!";
> while (<FINDIT>){
> print FINDOUT "$_";
> }
> close FINDIT;
> close FINDOUT;
> exit;
What is the difference between the program you have above, and doing
something like:
# grep 'pattern' /etc/hosts > temp1
Ok, another way:
#!/usr/local/bin/perl -w
use strict;
# Call this as
# ./scan_hosts string_to_match > output_file
#
# e.g.
# ./scan_hosts ^127\\.0 > outfile
#
# The double backslash is there to make sure that I get a single
# backslash in the script (the shell will consume one)
# The string to match might be a host name, or anything, really. If
# you want to limit it to 'subnets, you need to do a bit more work,
# like check that it is indeed a subnet specifier, reformat it, and
# make sure the match is bound to the start of the string (with ^).
# In this case, I only allow one string to match. You could loop over
# all of @ARGV and match each of the strings in turn, or you could join
# them together with | and match that once on every line.
my $match = $ARGV[0] || die "Need a string to match";
# Instead of opening a pipe to an external grep that opens /etc/hosts,
# we'll use perl's builtin grep, and open /etc/hosts directly.
open(HOSTS, "/etc/hosts") || die "Cannot open /etc/hosts to read: $!";
# Since /etc/hosts is never terribly large, we'll just process all the
# lines at once
#
# $match is used a regexp here, like you used it in your version. You
# will have to take care that what gets passed in is indeed what you
# intend, just like you would have to for the regexp after the shell
# grep.
# If you rather wanted to match a literal string, put \Q and \E around
# the pattern
# perldoc perlre
my @matched_lines = grep { /$match/ } <HOSTS>;
close(HOSTS);
# Of course, you are free to send output to an opened file handle,
# rather than to STDOUT, but I prefer these sorts of tools to not do
# that by default.
print @matched_lines;
__END__
In this script I don't need to check wether the pattern contains
naughty shell commands, because I never pass it to the shell.
Martien
PS. This also can be done in the following ways:
# perl -ne 'print if /^127\.0/' /etc/hosts
# perl -e 'print grep { /^127\.0/ } <>' /etc/hosts
Ok, enough
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Fri, 12 Jun 1998 00:19:54 -0400
From: Dave Wright <dhwright@mindspring.com>
Subject: ftp'ing within a perl script
Message-Id: <3580AC6A.220C@mindspring.com>
I am writing a Perl script that must run on both nt and solaris.
The script needs to transfer files via ftp. I tried code such as
the following sample to automate the ftp transfer:
<snip>
open(FD,"| ftp") or die "cannot start ftp session";
print FD "open samplehostname\n";
print FD "guest\n";
print FD "guestpassword\n";
print FD "put filename\n";
close(FD);
<snip>
but the script hangs when ftp prompts for the password. The password
supplied via the Perl script is apparently not accepted by ftp.
Is there a way to do what I want? I guess this is really not
a Perl problem but perhaps a limitation of ftp?
Thanks in advance,
Dave
dhwright@mindspring.com
------------------------------
Date: Fri, 12 Jun 1998 07:22:44 GMT
From: lehman@visi.com (Todd Lehman)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <8H4g1.874$bj2.4289526@ptah.visi.com>
rms@gnu.org (Richard Stallman) writes:
> Once upon a time, I thought I would learn Perl. I got a copy of a
> free manual, but I found it simply unreadable, and gave up. Perl
> users told me that there were better manuals, but they were not free.
It seems odd to deny oneself the pleasure of learning a new language for
several years simply because someone tells you that the best documentation
isn't freely available.
Was the decision a personal monetary issue or a moral issue?
For serious work, a Perl library of about 10 good titles costs around $300.
But you can get started for a small investment of $30 or $40, depending on
which book you choose. Alternatively, perhaps a friend or relative could buy
you _Programming_Perl_ or _Learning_Perl_ as a gift.
> Why was this? Their authors had sold the manuals to O'Reilly, instead
> of contributing them to the free software community.
But it was their choice.
> It wasn't the
> first time and (to our community's great loss) it was far from the
> last.
It was their choice. To suggest that it was a loss to the community is
to say that they were under some cosmic obligation to contribute free
documentation for the free software they created.
> O'Reilly and other publishers have enticed a great many authors
> to withhold their manuals since then. Partly as a result of this,
> partly because writing good English is a skill which most good
> programmers have not studied, a lack of documentation is one of the
> worst deficiencies of free operating systems today.
Exactly what are you blaming on whom? Ultimately, the blame for any
long-term deficiencies of any software system rests on the user community,
not on the authors or publishers.
> Perl is an important piece of free software, and it ought to have a
> *good* free manual.
I share the same *opinion*, but where does "ought to" come from? Says who?
Someone ought to sit down and spend gobs of their own spare time writing a
good free manual because someone unwilling to buy a non-free manual said so?
(Titles aside, that's what it comes down to, doesn't it?)
> So I added this item to the GNU task list, hoping
> this would encourage someone to write one.
Excellent.
> That was a few years ago. If there is now a good free manual, that's
> great. I'm always glad to remove an item from the task list because
> the job has been done. I might even buy a copy of this manual, if
> someone is selling them--especially if it is O'Reilly. (If we buy
> O'Reilly manuals only when they are free, we can encourage O'Reilly to
> publish and sell more free manuals.)
You almost sound bitter.
You should face the simple fact that you failed to motivate someone out
there to write what you wanted them to write.
But there is nothing wrong with that. You just need to try again -- perhaps
from a different angle -- or perhaps delegate the broader task -- enlist
someone who can drum up the enthusiasm and provide the needed motivation.
Or perhaps if you feel strongly enough, you could buy and read one or two
Perl books personally and provide a meaningful critique to the community.
It will be a lot easier for someone to justify writing a new book if a
visible hole is identified which needs filling in.
> But before I start celebrating, I ought to verify the facts--in
> particular, verify that the manual in question is actually free. The
> criterion for free documentation is basically the same as for free
> software: users have to be free to redistribute it, with or without
> changes, either gratis or for a fee, in any medium.
>
> As a general rule, I don't believe that it is essential for people to
> have permission to modify all sorts of articles and books. The issues
> for writings are not necessarily the same as those for software. For
> example, I don't think you or I are obliged to give permission to
> modify articles like this one, which describe our actions and our
> views.
>
> But there is a particular reason why the freedom to modify is crucial
> for a manual for free software. The most natural use of such a manual
> is to distribute it in free operating systems, along with the program
> it documents. And when people exercise their right to modify the
> software, and add or change its features, if they are conscientious
> they will change the manual too--so they can provide accurate and
> usable documentation with the modified program. A manual which
> forbids people to be conscientious and finish the job, or more
> precisely requires them to write a new manual from scratch, does not
> do the job.
>
> While a blanket prohibition on modification is unacceptable, some
> kinds of limits on modification are ok. For example, requirements to
> preserve the original author's copyright notice, the distribution
> terms, or the list of authors, are ok. It is also ok to have entire
> sections that may not be deleted or changed, as long as these sections
> deal with nontechnical topics. (Some GNU manuals have them.) These
> restrictions are not a problem because, as a practical matter, they
> don't stop the conscientious programmer from adapting the manual to
> fit the modified program. In other words, they are ok because they
> don't block the free software community from doing its thing with the
> program and the manual together.
>
> However, it must be possible to modify all the *technical* content of
> the manual; otherwise, the restrictions do block the community, the
> manual is not free, and we need another manual.
All excellent points.
> To be sure, many users find non-free manuals "useful". And they can
> indeed be useful, in a purely materialistic sense, just as non-free
> software can.
A correlation exists between usefulness and freeness?
> What they can't be is part of the free software
> community.
I would argue that the O'Reilly Perl books and TPJ are in fact very much a
part of the free software community (w.r.t. Perl) as they document a piece
of free software. Does not the free software community extend far beyond
the simple set of things which are free?
> I expect that I'll soon know whether Perl now has a good free manual.
> I hope that the answer will be yes, and that I'll be able to delete
> that item from the GNU task list. If not, I hope that someone will
> change the distribution terms on an existing good manual, or write a
> new one.
How can you hope to have any positive impact upon a piece of software
which you have as yet refused to learn? I understand your cause, but
you seem to have left the realm of personal sacrifice.
To put an item on a wish list and hope that maybe it gets done by some
volunteer someday is one thing. To put an item on a wish list and *expect*
that it gets done someday, then to look down on the community and its
favorite publisher for not having done it yet, is, frankly, a bit lordly.
> O'Reilly is just beginning to contribute to our community;
> most of what they do is still non-free, and thus no contribution. If
> O'Reilly's Perl manual is still non-free, making it free would be a
> fine way to take the next step in actually contributing to free
> software.
But O'Reilly makes contributions to the free software community every day by
publishing consistently high quality books on relevant subjects at reasonable
prices.
I delight in the accomplishments of GNU & FSF and, further, I use free
software (including GNU software) every day. But I never, ever take it
for granted.
--Todd Lehman
------------------------------
Date: 12 Jun 1998 15:14:24 +1000
From: "Lord Byron" <lordbyron@rapidnet.net.au>
Subject: hmmm, suggestions?
Message-Id: <01bb5827$75381880$29fa38cb@flaps>
Hi. I realise this is probably an annoying message, but I'm (trying) to
learn Perl, and I was wondering if any of you knew of a good way to
accelerate things? Are there any particularly good tutorials or books that
would help things out?
Cheers
Lord Byron
------------------------------
Date: 12 Jun 1998 04:05:20 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: I want threads, threads and more threads!
Message-Id: <897624319.30580@cabal>
In <Pine.LNX.3.96.980611164809.1456E-100000@kollwitz.doit.wisc.edu> "Gabriele R. Fariello" <gabriele@kollwitz.doit.wisc.edu> writes:
>On Thu, 11 Jun 1998, John Porter wrote:
[...]
>> Umm, have you considered the SysV IPC routines? msg*, shm*, sem* ???
>Heh, sorry not a SysV OS. It's on RedHat 5.0 Linux.
IIRC Linux dose implement the SysV IPC routines. So you are able to get
shared memory and selphors.
--
I'm a perl programer; if you need perl programing, hire me.
Please excuse my spelling as I suffer from agraphia; see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: 11 Jun 1998 16:18:13 -0700
From: Tobias Hoellrich <thoellri@tobias.corp.adobe.com>
Subject: Re: mailspinner.cgi
Message-Id: <yjzyav3v87e.fsf@tobias.corp.adobe.com>
redpeppa@my-dejanews.com writes:
> if anyone has a copy of mailspinner.cgi plz email me..im 18 and i really
> cant afford paying $1,000 when all im looking for is a personal web email
> client...thanks
>
Why don't you post your bank details here and I'd be more than happy
to transfer the $1,000 to your bank account? I'm sure others will
follow :-)
And by the way, what does this have to do with perl?
Geez
Tobias
--
[ This .sig intentionally left blank. ]
------------------------------
Date: Fri, 12 Jun 1998 03:37:55 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Newbie Net-DNS problems
Message-Id: <6lq7q3$brr@flatland.dimensional.com>
DerRunt@my-dejanews.com writes:
> I am trying to run the Net-DNS module on a Windows NT 5.00_04 perl
> installation. In the installation notes it tells me to change Config.pm in
> the /site/Net sub directory. I did this and then made the Net-DNS module
> with dmake. I ran all the Net-DNS tests and they worked. I then try the
> demos in Net-DNS sub directory and I receive
>
> query failed: no nameservers
>
> I have been looking all over for where to specify my name server to perl. My
> normal DNS resolution for the web works fine, so I think it is a perl config
> issue. Any help would be appreciated. Thanks.
The current release version of Net::DNS (0.12) probably won't work on
most non-Unix systems due to differences in socket implementations and
in the way the resolver is configured. You may or may not have more luck
with the latest development version (currently 0.13b9):
http://www.dimensional.com/~mfuhr/perldns/Net-DNS-current.tar.gz
http://www.dimensional.com/~mfuhr/perldns/Net-DNS-current.zip
I don't have any NT machines to play with, so I rely on input from
others for the changes necessary to make Net::DNS run on that platform.
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: 12 Jun 1998 04:15:57 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: NNTP module
Message-Id: <897624956.887108@cabal>
In <35809217.9A076942@akula.com> Francois <leurmy@akula.com> writes:
>I can't get a simple script to connect to my ISP's newsserver using
>NNTP. Does any one have a possible reason why?
>As far as I'm concerned, my program works fine. I just can't connect.
>I called my ISP who told me that all the modules are properly installed.
First can you connect to your ISPs newserver? what dose
telnet news.example.com NNTP do (change the host name).
If this works, try stepping threw what you think your script should do
against what the newsever is doing.
If that works, set up a little server that you can manule run and see what
the client is doing.
Hopefully you will be able to work out what is wrong.
--
I'm a perl programer; if you need perl programing, hire me.
Please excuse my spelling as I suffer from agraphia; see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Fri, 12 Jun 1998 00:38:26 -0400
From: Ruben Safir <75762.2332@CompuServe.COM>
Subject: Re: pack/unpack seps
Message-Id: <Oxanxvbl9GA.321@ntdwwaaw.compuserve.com>
I have a data file I need to parse, and UNPACK(a) and UNPACK(c) returns different
results. If I h[C[C[C[C[C
have a byte with is 219 in OCT - I wnated to know if it is represented different in C or A - What does it do, it looks at the byte and interprets it to an ascii representation of a integrer or what.
Ruben
------------------------------
Date: Thu, 11 Jun 1998 23:45:36 -0400
From: Rick Root <ric@arborsites.com>
Subject: Perl NT IIS4.0 - can't get Perl to work via the web
Message-Id: <3580A460.A8514A73@arborsites.com>
Okay.
I've got Perl 5 (from ActiveWare?) installed on our Windows NT 4.0
(sp3) server running IIS 4.0.
I've read the FAQs. I've looked all over the registery. I've checked
file and directory permissions. I've checked access restrictions
in the Internet Service Manager.
I've done it all twice.
I can run scripts from the command line (while logged in interactively).
I can run scripts by double clicking on them in Explorer.
But when I try to access the script via the web - nope.. it just
waits and waits and waits for a reply. No error message (I
suppose eventually it'll timeout), no nothing.
The internet guest user has read/execute permissions on the script
and the directory it's in. The directory has execute permissions
in the internet service manager.
I even added this key (as found in the Perl for Win32 FAQ)
HKEY_LOCAL_SYSTEM, with the sub-key
"System\CurrentControlSet\Services\W3SVC\Parameters\Script Map"
I assigned ".pl" to "C:\Perl\bin\perl.exe"
nothing seems to work and I've been at this for hours :(
The same Perl distribution btw works fine on our other server running
IIS 3.0, though I think I had trouble getting it to work there too.
Wish I remembered what I had to do to get it to work.
Anyway, any/all help would be greatly appreciated on this issue.
Thanks!
Rick Root
No really, my last name is Root.
------------------------------
Date: 11 Jun 1998 23:57:47 -0500
From: Quentin Fennessy <quentin@shaddam.amd.com>
Subject: Re: Perl to newsgroups - how?
Message-Id: <xim67i7z06s.fsf@shaddam.amd.com>
>>>>> "Alex" == wrs <wrs@mailcity.com> writes:
Alex> Hi there! I am looking for a way to post messages to
Alex> newsgroups from web. Something like DejaNews. But I want to
Alex> implement WebBBS in order that as someone posts message on
Alex> it, it also posts on several newsgroup.
Alex> Any ideas how it can be done in Perl or C?
Alex> I am willing to pay as long as price is reasonable.
Any Vikings for hire around here?
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: Thu, 11 Jun 1998 22:18:26 -0700
From: Michael Stearns <michael@datahost.com>
Subject: Removing duplicates
Message-Id: <3580BA22.5BDF@datahost.com>
Hello:
I have a text file with about 700 lines.
I would like to remove duplicate lines from the file.
Can someone recommend a good way to do this?
Thanks,
Michael Stearns
------------------------------
Date: Fri, 12 Jun 1998 05:50:49 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Removing duplicates
Message-Id: <Zk3g1.94$34.1564151@news2.voicenet.com>
Michael Stearns <michael@datahost.com> wrote:
>I have a text file with about 700 lines.
>
>I would like to remove duplicate lines from the file.
>
>Can someone recommend a good way to do this?
Wow... is this a troll? Am I going to get flamed if I suggest
something like:
$ sort file | uniq
Hmmm. Better play it safe. If you're not concerned about the order of
the lines, then this is a fun way to do it:
%outp = map { $_, 0 } <>;
for (keys %outp) { print; }
Assuming the file you want to fix is specified on the command line.
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: Thu, 11 Jun 1998 23:55:56 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: michael@datahost.com
Subject: Re: Removing duplicates
Message-Id: <3580D0FC.12E64A32@sirius.com>
Michael Stearns wrote:
>
> I have a text file with about 700 lines.
> I would like to remove duplicate lines from the file.
> Can someone recommend a good way to do this?
This is memory intensive but it works even if the duplicates
are not consecutive:
my %lines;
while(<>) {
$lines{$_}++ or print;
}
If you know that the duplicate lines are consecutive,
then you can save memory by saying
my $last = '';
while(<>) {
$last eq $_ or print;
$last = $_;
}
HTH -- Jim Bowlin
------------------------------
Date: Thu, 11 Jun 1998 22:29:33 -0700
From: Michael Stearns <michael@datahost.com>
Subject: removing dups from a file
Message-Id: <3580BCBD.7053@datahost.com>
Hello:
I have a text file with about 700 lines.
I would like to remove duplicate lines from the file.
Can someone recommend a good way to do this?
Thanks,
Michael Stearns
------------------------------
Date: Thu, 11 Jun 1998 22:49:39 -0700
From: Michael Stearns <michael@datahost.com>
Subject: removing dups from files
Message-Id: <3580C173.79@datahost.com>
Hello:
I have a text file with about 700 lines.
I would like to remove duplicate lines from the file.
Can someone recommend a good way to do this?
Thanks,
Michael Stearns
------------------------------
Date: 12 Jun 1998 07:04:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: removing dups from files
Message-Id: <6lqjtv$bk3$1@comdyn.comdyn.com.au>
In article <3580C173.79@datahost.com>,
Michael Stearns <michael@datahost.com> writes:
> Hello:
>
> I have a text file with about 700 lines.
>
> I would like to remove duplicate lines from the file.
>
> Can someone recommend a good way to do this?
You also have sent three duplicate posts to this group.
Anyway, a unix way to do it:
# sort input_file | uniq > output_file
I am not sure if dos/win32 have uniq.
some perl ways:
- Read in the file, line by line, storing the lines as hash keys, then
write out the hash keys to disk.
- Read in the file in an array, and follow the answer in perlfaq4 to
the question 'How can I extract just the unique elements of an
array?' There are 5 suggestions.
As a one liner:
# perl -ne 'print unless $a{$_}++' input_file > output_file
or
# sort inputfile | perl -e 'print grep ($_ ne $p && ($p = $_), <>)'
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Fri, 12 Jun 1998 03:15:20 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: reverse sorting
Message-Id: <8cogvznwe9.fsf@gadget.cscaper.com>
>>>>> "Michael" == Michael J Gebis <gebis@albrecht.ecn.purdue.edu> writes:
Michael> sort { $b <=> $a} @srclist;
I know you didn't precisely mean that, but in case someone's watching
over your shoulder and doesn't get it...
@result = sort { $b <=> $a } @source;
It is silly to sort in a void context...
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 81 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 12 Jun 1998 03:29:50 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: reverse sorting
Message-Id: <1dahfx9.sjgqjp14wk60lN@roxboro0-047.dyn.interpath.net>
Randal Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "Michael" == Michael J Gebis <gebis@albrecht.ecn.purdue.edu> writes:
>
> Michael> sort { $b <=> $a} @srclist;
>
> I know you didn't precisely mean that, but in case someone's watching
> over your shoulder and doesn't get it...
>
> @result = sort { $b <=> $a } @source;
>
> It is silly to sort in a void context...
I don't know - Abigail might do so instead of using wait.
--
John Moreno
------------------------------
Date: Thu, 11 Jun 1998 23:41:34 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: search problem in cgi script
Message-Id: <alecler-1106982341340001@dialup-384.hip.cam.org>
In article <357eb5ac.439714105@news.usaor.net>, 6xtippet@CyberJunkie.com wrote:
> On 10 Jun 1998 13:33:43 GMT, "bea" <beatrice.pastor@univ-brest.fr>
> wrote:
>
[...]
> >I'd like to know what is the syntax for a search only on the beginning of a
> >word.
>
> You didn't provide the code so I will take a guess.
> Assuming thae the variable $last_name contains the last name:
>
> if( $last_name =~ /^le/ )
> {
> # The first two characters of $last_name are 'le'
> ...
> }
>
A tiny correction: since we're matching the beginning of a last name, it
would be a good idea to make the regexp case-insensitive.
$last_name =~ /^le/i
A.L.
------------------------------
Date: 12 Jun 98 05:50:19 GMT
From: mike@bga.com (Mike Mckinney)
Subject: suggestions for improving efficiency ?
Message-Id: <slrn6o1ger.70l.mike@mike.local.net>
I am very new to Perl, and programming in general, and this simple script
is really the only thing I can currently think to use Perl for. I have made
a good start on the "Learning Perl" book, but can't as yet afford the Camel
book.
I would very much appreciate any suggestions for improving the efficiency of
the following program, and removing alot of obfuscation I'm sure.
It's not totally done, as I have yet to add some code for generating a report,
but it's workable in it's current form.
------------------------------------------------------------------------------
#!/usr/bin/perl -w
use diagnostics;
use strict;
# A simple program to prompt for two numbers ( daily water usages ), and then
# open one of two files for writing the date and the gallons used.
my ( $softener, $cooling ) = ( "softener.usage", "cooling.usage" );
my $used = " gallons used\n";
my @month = split( / /, `date` );
my @date = join( " " ,@month[0,1,2] ) . ": ";
while ( 1 ) {
print "\nWhich file will you be using (Water or cooling ) :\n";
chomp( my $answer = <STDIN> );
if( $answer =~ /^w/i ) {
print "Okay, using file $softener\n";
open( SOFTENER, "+>>$softener")
|| die "Can't open file $softener : $!";
print SOFTENER @date, TOTAL(), $used,;
close( SOFTENER ) || die "Can't close file $softener: $!";
print "Okay, data successfully written to $softener\n";
last;
} elsif( $answer =~ /^c/i ) {
print "Okay, using file $cooling\n";
open( COOLING, "+>>$cooling" )
|| die "Can't open $cooling : $!";
print COOLING @date, TOTAL(), $used,;
close( COOLING ) || die "Can't close file $cooling : $!";
print "Okay, data successfully written to $cooling\n";
last;
} elsif ( $answer =~ /^q|n/i ) {
print "Closing program with no data entered or saved\n";
last;
} else {
print "You must enter one of the two file names for calculations!\n"
}
}
sub TOTAL {
print "Enter the first number : ";
chomp( my $first = <STDIN> ) ;
print "Enter the second number : ";
chomp( my $second = <STDIN> ) ;
my $sum = $first + $second;
return( $sum );
}
--
mikem@wans.net , mike@bga.com
------------------------------
Date: 12 Jun 1998 02:50:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Voting for the new, high-signal perl newsgroup
Message-Id: <6lq51n$b4o$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, sowmaster@juicepigs.com (Bob Trieger) writes:
:-> Let their own words speak for them.
:I did the other day and probably noticed and feel the same way you do.
Pretty frightening, eh?
:-> And let's please keep this to news.groups where it belongs.
:It's discussion on perl newsgroups which is equivalent to "misc" in my book.
:Besides that, I don't follow news.groups but I do follow clpm.
Well, I guess there's the risk we won't have enough normal Perl
participants paying attention to the vote. Very well: I note that even
were all the raving nay-sayers' worst nightmare to come true, we'd still
be much better off *with* the successful passage of the group than
we are now. Its passage cannot hurt. Its non-passage cannot help.
Definitely a no-brainer.
--tom
--
"... the whole documentation is not unreasonably transportable in a
student's briefcase." - John Lions describing UNIX 6th Edition
"This has since been fixed in recent versions." - Kernighan & Pike
------------------------------
Date: 12 Jun 98 06:12:18 GMT
From: arromdee@www.inetnow.net (Ken Arromdee)
Subject: Re: Voting for the new, high-signal perl newsgroup
Message-Id: <3580c6c2.0@news.inetnow.net>
In article <6lq51n$b4o$4@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>Well, I guess there's the risk we won't have enough normal Perl
>participants paying attention to the vote. Very well: I note that even
>were all the raving nay-sayers' worst nightmare to come true, we'd still
>be much better off *with* the successful passage of the group than
>we are now. Its passage cannot hurt. Its non-passage cannot help.
Its passage most certainly can hurt. It'll drain off traffic from an
unmoderated group, while its very presence would make creating a second
moderated group difficult.
--
Ken Arromdee |They said it was *daft* to build a space
arromdee@inetnow.net |station in a swamp, but I showed them! It
karromde@nyx.nyx.net |sank into the swamp. So I built a second
http://www.inetnow.net/~arromdee|space station. That sank into the swamp too.
--------------------------------+My third space station sank into the swamp.
So I built a fourth one. That fell into a time warp and _then_ sank into the
swamp. But the fifth one... stayed up! --Monty Python/Babylon 5
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 2852
**************************************