[8090] in Perl-Users-Digest
Perl-Users Digest, Issue: 1709 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 22 20:07:43 1998
Date: Thu, 22 Jan 98 17:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 22 Jan 1998 Volume: 8 Number: 1709
Today's topics:
Re: ? random text string (brian d foy)
Re: @ == @, comparing arrays (Martien Verbruggen)
Re: @INC on winNT (Martien Verbruggen)
Re: Command line file editing/substitution (Martien Verbruggen)
Re: Executing another Perl script from inside one. (brian d foy)
Re: extract username from basic protection scheme (brian d foy)
Re: Help w/ regexp (brian d foy)
Re: Help w/ regexp (Martien Verbruggen)
Re: How can i find files in dir. (brian d foy)
Re: Install Trouble. (Martien Verbruggen)
Re: living and free software (was: Re: source into bina (John Stanley)
Re: LWP/SSLeay memory leak? (Kirby Hughes)
Re: New Perl-Oriented Web Site has materials not availa (brian d foy)
Re: Non-Parsed Headers (NPH) and Sockets (brian d foy)
Re: OPEN command problem (brian d foy)
Re: Programmers Wanted (brian d foy)
Re: Reg Expression, can it be improved? (Charles DeRykus)
Re: source into binary code (John Stanley)
Re: space searching? (Steven M. O'Neill)
Re: Unkown Error (Martien Verbruggen)
Re: Wierd error messages??!! (brian d foy)
Re: Wierd error messages??!! (Martien Verbruggen)
Re: Wierd error messages??!! (Martien Verbruggen)
Re: Win32 PERL Newbie question (Martien Verbruggen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 22 Jan 1998 19:12:23 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: ? random text string
Message-Id: <comdog-ya02408000R2201981912230001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C78FCE.2781@runge.uni-c.dk>, "Lars Kr. Lundin" <lkl@runge.uni-c.dk> posted:
>Can anybody tell me how to produce a random text string that matches
>/^\w{8}$/ ?
>
here's a bit of code i wrote while thinking about randomly
compiled strings:
#!/usr/bin/perl
my $i;
while(1)
{
my $word;
while (length $word != 8 )
{
my $number = int(rand(127));
next if $number < 42;
$word .= chr($number);
}
eval "$word";
if($@) { print "$@\n" } else {print "$word" }
sleep 1;
}
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: 22 Jan 1998 23:49:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: @ == @, comparing arrays
Message-Id: <6a8lv0$cdp$1@comdyn.comdyn.com.au>
In article <34C792B6.21A7@wco.com>,
Steven Smith <steves@wco.com> writes:
> I had assumed that @a1 == @a2 would compare two arrays and
> tell me if they were the same. It doesn't and that makes
> sense to me -- we're taking the arrays into scalar context
> and comparing the number of elements in each group, right?
yep.
> Is there an easy way to tell if all elements of the array
> are the same short of a short subroutine?
if (join('', @a) eq join('', @b)) {}
if ("@a" eq "@b") {}
Of course, this potentially uses lots of memory, and isn't totally
reliable. And what happens if you've got undefined members? And
consider the following:
@a = qw( foo bar baz );
@b = qw( fo ob ar ba z );
(putting in a join string won't solve this. I'll always be able to
come up with some special case to break it.)
If you had done a search on dejanews for:
[~g:comp.lang.perl.misc +arrays +compare]
You would have found these answers as well.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: 23 Jan 1998 00:06:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: @INC on winNT
Message-Id: <6a8mto$cj7$2@comdyn.comdyn.com.au>
In article <34C7B39A.2FACCA81@nowhere.net>,
adam <none@nowhere.net> writes:
> for some reason when perl is run from the command line it has the
> correct paths in @INC, yet when i execute cgi/perl scripts through the
> web server @INC is empty. and i can't seem to assign to it.
is it the same perl? You can't assign to it? Are you assigning to it in the
right way?
use lib 'whatever';
or if you MUST play with @INC directly (please don't)
BEGIN{ unshift(@INC, 'whatever') }
> does anyone know what i am talking about?
Marginally.
> any help much appreciated
Sure.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 23 Jan 1998 00:37:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Command line file editing/substitution
Message-Id: <6a8op4$cj7$8@comdyn.comdyn.com.au>
In article <34c7d30c.13919841@news.digex.net>,
webmaster@gardenweb.com (Spike Hernandez) writes:
> perl -p -i -e "s/(fred)\w+/$1/;" filename
>
> ...there is no substitution.
Your shell is probably expanding $1 before perl ever sees it. Use
single quotes or escape the $:
perl -p -i -e 's/(fred)\w+/$1/;' filename
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In the fight between you and the world,
Commercial Dynamics Pty. Ltd. | back the world - Franz Kafka
NSW, Australia |
------------------------------
Date: Thu, 22 Jan 1998 19:29:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Executing another Perl script from inside one.
Message-Id: <comdog-ya02408000R2201981929350001@news.panix.com>
Keywords: from just another new york perl hacker
In article <885445862.689988@citroen>, "Fabiano Vanucci" <vanucci@sp.dglnet.com.br> posted:
>Can Exec() function execute another script that isn't on the same web site?
perhaps you want LWP.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Thu, 22 Jan 1998 19:32:28 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: extract username from basic protection scheme
Message-Id: <comdog-ya02408000R2201981932280001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6a4kql$smr@bgtnsc01.worldnet.att.net>, "Michael R. Harper" <mikihasa@worldnet.att.net> posted:
>I would like to be able to extract the User Name from the dialog box
>that gets presented to the user when trying to access a directory
>protected by the basic protection scheme (.htaccess, .htpasswd,
>WWW-Authenticate, 401 Unauthorized, etc.) using a web browser.
>
>Any ideas? Where do I start?
since this isn't a perl issue, you might want to check in a group
that discusses such issues - perhaps comp.infosystems.perl.authoring.cgi.
you could also look in the CGI Meta FAQ to find Nick Kew's "Login
on the Web" tutorial.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Thu, 22 Jan 1998 19:02:14 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help w/ regexp
Message-Id: <comdog-ya02408000R2201981902140001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C7CA6A.20B9D23B@weboneinc.com>, Douglas Clifton <doug1@weboneinc.com> posted:
>I'm trying to figure out a way to match a range of numbers.
>I know about the [0-9] syntax, but the numbers would be
>more like 15-31, [15-31] does not work.
>
>I know this is not that difficult to do, the problem is the
>range is not known untill run-time and would be in
>scalar variables like $beg and $end.
if( $number >= $beg and $number <= $end ) { ... }
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: 23 Jan 1998 00:34:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help w/ regexp
Message-Id: <6a8ohq$cj7$7@comdyn.comdyn.com.au>
In article <34C7CA6A.20B9D23B@weboneinc.com>,
Douglas Clifton <doug1@weboneinc.com> writes:
> I'm trying to figure out a way to match a range of numbers.
> I know about the [0-9] syntax, but the numbers would be
> more like 15-31, [15-31] does not work.
Are you trying to do this with a regexp? Why?
> I know this is not that difficult to do, the problem is the
> range is not known untill run-time and would be in
> scalar variables like $beg and $end.
if ($beg >= 15 and $end <= 31) { ... }
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: Thu, 22 Jan 1998 19:15:55 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How can i find files in dir.
Message-Id: <comdog-ya02408000R2201981915550001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C67A50.327@cse.bridgeport.edu>, seong@cse.bridgeport.edu posted:
>My question is that How can i find files with extention 'html' or
>'htm'.
my @files = grep /\.html?$/, readdir DIRHANDLE;
as seen in the readdir documentation;
>As you can see from my subroutine, this will search all of html and htm
>files on specific dir recursively.
>Please help me to make this subroutin work.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: 23 Jan 1998 00:31:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Install Trouble.
Message-Id: <6a8odc$cj7$6@comdyn.comdyn.com.au>
In article <34C7CE07.B0043EB0@ipcc.com>,
"Edward D. Silver" <ed@ipcc.com> writes:
> Last time I installed PERL 5.001 it was a breeze. Now I'm trying to
> install PERL 5.004 on a new DEC ALPHA running Digital Unix v4.0D.
>
> I keep getting the errors listed below:
> Okay, let's see if #! works on this system...
> Configure: ./try: cannot execute
> Configure: ./try: cannot execute
> It's just a comment.
>
> Checking out how to guarantee sh startup...
> Let's see if ': use /bin/sh' works...
> Configure: ./try: cannot execute
> Nope. You may have to fix up the shell scripts to make sure sh runs
> them.
>
> Locating common programs...
> Configure: ./loc: cannot execute
> I don't know where 'awk' is, and my life depends on it.
> Go find a public domain implementation or fix your PATH setting!
What is unclear about the error messages? Your shell implementation
sucks. Your path is probably set incorrectly. What is the shell this
is running in? What do you type? Did you read the file INSTALL?
The basic steps to build and install perl5 on a Unix system are:
rm -f config.sh
sh Configure
make
make test
make install
Did you do that? If you did, what does sh refer to in your setup?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 23 Jan 1998 00:31:42 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: living and free software (was: Re: source into binary code)
Message-Id: <6a8ode$c2i$1@news.orst.edu>
In article <54lnw8hlah.fsf@gunnar.aladdin.net>,
Piers Cawley <pdcawley@bofh.org.uk> wrote:
>21 Jan 1998 21:05:48 GMT stanley@skyking.OCE.ORST.EDU (John Stanley) comp.lang.perl.misc
>> >Heh, I don't consider free software to be worthless, that's why I
>> >often pay for it; A decent Linux distribution on CD is better value
>> >than the time I spend with my phoneline tied up waiting for it to
>> >download.
>>
>> Oops, the cat's out of the bag. Someone is violating the GPL. Or maybe
>> you aren't paying for the software after all?
>
>Go read the GPL again. Please?
Fish in a barrel. Ok. Point by point, using the GPL as found in the
perl5.003_92 distribution.
Paragraph one ends with:
... You may charge a fee for the physical act of transferring a copy.
Paragraph 2d:
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Paragraph 3b:
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
And finally, paragraph 4:
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License.
These are the only references in the "precise terms and conditions" to
fees. Notice that the only two types of fees that are mentioned are 1)
fees for "warranty protection" and 2) charges for the cost of
distribution. Those are the "expressly provided" allowances for fees.
It says nothing about selling the code itself.
If you are paying for the "free software", the person selling it to you
is in violation of the GPL and has no rights to use the Program (or
send it to you, for that matter) under the GPL. Or, like I said above,
you aren't paying for the software after all.
>Okay, I'm a latecomer to this thread. Who made the claim that such a
>thing was possible without later amending it? Message-ids would be good.
I will tell you exactly what almost everyone else who asks a question
about something that was said recently. Read the thread, or use
DejaNews.
>> That's nice. Now provide proof that those who hoard code are harmful to
>> society.
>
>Why should I? That wasn't the point I was making.
No, that was the point that Greg was making and I asked him to provide
support. YOU dropped in and replied to that challenge, so I assumed you
were taking up the challenge. Excuse me for assume you were replying
on-topic.
>And you pulled said statement out of context and demanded that its
>originator retract or prove it.
I quoted one statement out of an article and assumed that anyone who was
reading the thread could either remember the context or look it up for
themselves. I didn't plan on you.
>Ooh... I just checked the rest of your post again and, what a surprise
>you cut the following from a later paragraph:
>
>> > It could be argued that not releasing source makes you a parasite
>> > on hacker society, but parasites do actual harm to the host,
>> > you're just an irritant.
I cut it because it makes the silly assumption that every code author
who has ever refrained from releasing code got that code from a hacker
and didn't write it himself. Ok. I'll point out how stupid an assumption
that is, if you want. Or maybe "parasite" isn't the term you wanted to
use?
>> >> The work is available to anyone who wants to use it. You cannot
>> >> see how it was done, just as I cannot walk into HP and expect to
>> >> see how they fab the chips for the calculator I just bought, nor
>> >> can I learn how by grinding the top off the chips in the one I
>> >> bought.
>> >
>> >But people can and do.
>>
>> Please read the statement I made. First person. Yes, SOME PEOPLE get
>> to walk into HP and get the full tour with disclosure of proprietary
>> processes and such. That is hardly what I would call "free
>> disclosure".
>
>Tell you what, read the statement I made. Go on, I dare you. Is it
>apparent to you that I was refering to the clause that came after the
>'nor'? If not, why not? Or did you understand perfectly but decide to
>break the paragraph to make a cheap debating point?
It really doesn't matter which half of the nor you were referring to,
the answer is the same. Yes, some people have the resources to grind
chips up and learn how to make them, but I do not. It is not common
knowledge.
>> Yes, but when you have source sitting right in front of you, it is not
>> cheaper to buy the right to use to code from the author, it is a simple
>> matter of running the code.
>
>Well, I can't comment on your ethics in this situation,
Then don't make cheap shots about it. I didn't say I was doing this. Do
you deny that it is done? If so, you are too naive.
>> >> Don't be silly. Anyone can benefit from what I've learned, they
>> >> just have to pay for it.
>> >
>> >Ah... anyone who can afford to can benefit from what you've learned.
>>
>> Well, that is quite different from "no one", now isn't it?
>
>And quite different from 'anyone' too.
No. All it takes is the money. But then, I said that the first time,
too.
>> Of course there are those risks. I think it is a much greater risk
>> if the technician employed by the hospital to install PC's tries to
>> fix the MRI code than if they had to wait to call GE.
>
>Then said technician would be rightly sued to within an inch of its
>life, and hopefully beyond.
Which didn't stop him from doing it, now did it? And he would only be
sued if he failed in some obvious way. Suppose he does it three times
without failure in a way that makes the reading worthless? Or in a way
that overradiates the patient enough that the problems show up in 20
years. Who is going to be able to trace the cause after that long?
>I would assume that the manager who hired
>such a terminally stupid luser would get hammered too.
The manager who kept the machine running and making money for the
hospital would be rewarded. In twenty years, he will be dead from
natural causes and not available to "hammer" when the effects show up.
>> Or what if the business owner tries to fix the code, and uses
>> ">file" to open a critical file instead of >>?
>
>Then he screws up and loses his file. What is your point?
It cost him a bunch of money, and the ability to modify the code is
what led him to that loss. No source, no loss.
>> What is the cost of doing a restore from last backup? What if the
>> tinkerer doesn't notice the problem until he's cycled through
>> several backups and the file is gone?
>
>Then he would pay for his own stupidity. I still don't see your point.
And this payment is supposed to be an advantage to him?
>> So people who make you pay to find out things they have learned are
>> ok after all.
>
>Um... you missed out the statement where I said that what I was paying
>for was not the learning but the piece of paper at the end to prove I
>had learnt it (well, actually, I didn't pay for my tuition, my parents
>and all the other UK taxpayers did). But of course that would weaken
>your argument wouldn't it?
No, I would just point out that you don't get a diploma from taking one
college course, even though you have to pay tuition for it. You don't
pay the money for the paper, or else it wouldn't be unethical to sell
you the paper without making sure you had the knowledge from the
courses.
>> >You keep using this argument, I'm not sure it means what you think it
>> >means. Of course the doctors won't benefit from seeing the code.
>> >They're almost certainly bright enough to know this and if they did
>> >have access to it they wouldn't go near it.
>>
>> Please show me in the definition of "free software" the part that says
>> that only those who are bright enough to know they shouldn't touch the
>> code may get copies of the source. If you are going to argue a policy,
>> you have to argue the warts, too.
>
>Nowhere. Why should it?
Because you are arguing that certain people won't benefit from the code
and thus don't need to get it. If you are going to define a category of
people who don't get covered by the "free software" concept, then that
concept should mention them, instead of being a blanket coverage.
>If some luser decides to tinker with the code
>and breaks it, well, them's the breaks.
Yep, and it sure puts the hoots to the idea that it is always a benefit
for everyone to get source.
>> >It doesn't mean that I wouldn't be interested in seeing said code,
>> >they may have used some clever technique of which I was previously
>> >unaware that I can borrow and use in a completely different
>> >application.
>>
>> Yes, you mean that you can use someone's intellectual property
>> without paying for the development of that property.
>
>I think we're arguing at different levels here. It is my belief that
>making programming *techniques* proprietary is akin to doing the same
>with mathematical proofs.
Good or bad, it is. I don't particularly truck with software patents
either. That doesn't mean I think every piece of software I use must
come in source.
>Remember that in an environment where source
>code is readily available then everyone is free to learn from everyone
>else's code.
Yes, that means that a programmer who is being paid by X to develop code
can learn from the programmer at company Y, who paid for the code to be
developed, and can save a lot of X's time and money by using Y's code.
If X is a competitor to Y, then Y just paid to improve their competitor's
product. Y has no advantage, so why should they pay to improve? They
just spend money to wind up where they were in the first place. And
maybe if they DON'T pay to improve, X will be stupid enough to give
their code away and THEY can use it for free.
>> And who is going to stop you from using this in a competing
>> application? Yes, copyright and patent law will allow them to sue
>> you if you do, but that is a costly and time-consuming process that
>> is much better to avoid.
>
>Indeed. But we already have a situation where people are ripping off
>others work where source code is not available. It happens all the
>time. Hell, IBM are probably still smarting because people cloned
>'their' PC. We're (arguably) better off because of the clones though.
In most cases, this "ripping off" is of code that has no protections.
It is trivial to copy code that isn't protected, and it does, according
to the agencies who make this their interest, cost the developers a lot
of money. If they don't have the money to pay for more or better
programmers, the code isn't as good as it could be.
Now, one way to stop the "ripping off" is to include licensing
enforcement. So what if you copy a program but you can't run it? You can
"rip off" the copy, but you don't get any benefit from it, so why
bother? If the only way you can distribute code is in source, then it is
ridiculous to include any licensing enforcement because it is trivial
to remove.
>> Then not contributing to human knowledge isn't such a bad thing. Ok,
>> that's all I wanted to hear someone admit.
>
>Well, it's not such a bad thing that you would be justified in
>shooting someone because they don't do it.
And maybe it isn't such a bad thing that it deserves contempt.
>However, if you make use of
>techniques which are given freely to (perl|hacker) culture and don't
>give something back then you should not be surprised if those whose
>shoulders you stand on resent your weight.
Ummm, what happened to the basis for free software? Where did the
"there's a difference between copying code and copying a calculator" go?
Is copying someone's code when they freely give it away really a burden
on them? If I make 1000 copies, am I 1000 times the burden? Oops, you
said "weight". Do I weigh 1000 times as much if I make 1000 copies of
perly.y instead of just one?
------------------------------
Date: 22 Jan 1998 16:50:00 -0700
From: kirbyh@primenet.com (Kirby Hughes)
Subject: Re: LWP/SSLeay memory leak?
Message-Id: <6a8lv8$2sp@nntp02.primenet.com>
In article <m367nc3kpt.fsf@furu.g.aas.no>, Gisle Aas <aas@sn.no> wrote:
:kirbyh@primenet.com (Kirby Hughes) writes:
:
:> The following program will eat memory until you run out.
:> s/https/http/ and the problem goes away. I cannot track down the problem
:> so far. Any ideas?
:
:You did not say which version of libwww-perl you used. Can you try it
:with libwww-perl-5.18_05 and Crypt-SSLeay? It uses a different SSLeay
:interface than the previous versions of LWP.
I just now tried it with:
perl 5.004_04 built for sun4-solaris
libwww-perl-5.18_05
Crypt-SSLeay .06
and have the same results (more and more memory being used) (vsz or vsize).
Also tested on digital unix v4.0a with same results.
btw... My SSLeay libs are old, 0.6.4. I will try newer ones for fun.
-Kirby
:
:> #!/usr/local/bin/perl -w
:>
:> use strict 'vars';
:> use LWP::UserAgent;
:>
:> while (1) {
:> get_http();
:> sleep 2;
:> }
:>
:> sub get_http {
:> my ($req, $res);
:> my $ua = new LWP::UserAgent;
:> $ua->agent("Mozilla/3.01 (X11; I; SunOS 5.5.1 sun4m)");
:> $req = new HTTP::Request GET => "https://site/";
:> $res = $ua->request($req);
:> }
:
:--
:Gisle Aas
------------------------------
Date: Thu, 22 Jan 1998 19:44:23 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: New Perl-Oriented Web Site has materials not available elsewhere
Message-Id: <comdog-ya02408000R2201981944230001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6a8kar$9ch$1@news1.teleport.com>, Mark-Jason Dominus <mjd@plover.com> posted:
>My Perl Paraphernalia web site, at
>
> <URL:http://www.perl.com/~mjd/perl>
File Not Found
The requested URL /~mjd/ was not found on this server.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Thu, 22 Jan 1998 19:27:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Non-Parsed Headers (NPH) and Sockets
Message-Id: <comdog-ya02408000R2201981927300001@news.panix.com>
Keywords: from just another new york perl hacker
In article <19980122132201.IAA04653@ladder01.news.aol.com>, scriptman@aol.com (Scriptman) posted:
>Pete Sattler
>Chase Manhattan Bank
[is that the one the makes change?]
>############################# CGI SCRIPT ########################
>#!/usr/bin/perl
no -w ?
>select STDOUT; $| = 1;
>print "HTTP/1.0 : 200 OK\n";
what's that : doing there?
>print "Content-type: text/html\n";
>open(UTILOUT,"whutilc.pl run p_sattle cvserv ping dmeserv 100 9 |"); #FAILED
>open(UTILOUT,"whutilc.pl run p_sattle cvserv ping dmeserv 100 9 & |"); #FAILED
no error checking?
does the CGI environment know where to find these executables? (and
if it does, doesn't that bother you?)
what happens when you run this from the command line?
what does "FAILED" mean?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Thu, 22 Jan 1998 19:07:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: OPEN command problem
Message-Id: <comdog-ya02408000R2201981907390001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6a8atv$srn$1@hermes.seas.smu.edu>, "Scott Norris" <snorris@post.cis.smu.edu> posted:
>I have tried to edit files in one of my scripts; sort of a simple database
>management project to benefit my school. However, my scripts crash. Among
>other problems, it says I am using the wrong syntax on the OPEN command.
no it didn't.
>&getdata
what's missing in the above line?
>open LIST, "+>>/textbook/booklist.csv";
even when your script is just an example, check the
return values:
open LIST, $file or die "$file: $!";
>while (<LIST>) {
> if /$form{IDno}/ {
> s/<LIST>// or die "Can't delete record";
> $success = 1;
> last;
> }
>}
>
>Then, is the s/<LIST>// an acceptable way to erase a line in a data file?
no. see the FAQ on removing/modifying/adding lines to a file.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Thu, 22 Jan 1998 19:38:45 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Programmers Wanted
Message-Id: <comdog-ya02408000R2201981938450001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34c2dca8.7511683@news.eur.sprynet.com>, www.imaristudios.com posted:
>NOTE: We are telling you right now ahead of time that these
>"positions" are *****NON-PAYING*****!
>
>We are offering you the opportunity to get real experience behind you
>by working on real applications on live websites.
translation: we are a start-up company with no financing and no
technical experience. you will develop the concept that we'll
show to others to get financing. once we have money we will hire
real programmers and dump you.
at least i pay my interns, even though they don't get credit on
the "real live website", but then, neither do i :)
--
brian d foy <comdog@computerdog.com>
the joys of working in Silicon Alley, where this happens everyday
------------------------------
Date: Thu, 22 Jan 1998 22:52:07 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Reg Expression, can it be improved?
Message-Id: <En7JIw.E67@bcstec.ca.boeing.com>
In article <885493633.964624396@dejanews.com>, <poster3001@hotmail.com> wrote:
>[ My last post seems to have gotten garbled a bit, so I'll try again.]
>
>In article <885395443.1027342350@dejanews.com>,
> rlee@spcbrass.com wrote:
>>
>> #!/usr/bin/perl -wT
>>
>> my $rec = "";
>> my $a;
>>
>> $_ = "This is a TEST \"Sammy 1st Birthday\" and \"SUZZY\" ABCdef019Ab";
>>
>> [snip]
>
># This works but gives "uninitialized" warnings with -w:
>
>s/([^"]*)("[^"]*")?/\L$1\E$2/g;
Great solution. A slight improvement might be:
s/([^"]*)(".*?")?/\L$1\E$2/g; # ".*?" vs. "[^"]*"
It's a bit ugly, but I'd be tempted to say:
{ local $^W =0; s/([^"]*)(".*?")?/\L$1\E$2/g }
rather than grow the regex so much and slow
things with an eval just to avoid the -w warnings.
Regards,
--
Charles DeRykus
------------------------------
Date: 23 Jan 1998 00:54:18 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <6a8pnq$psb$1@news.orst.edu>
In article <34C77B9C.278C@min.net>, John Porter <jdporter@min.net> wrote:
>John Stanley wrote:
>> In article <eyhd8hodpv9.fsf@liddell.cstr.ed.ac.uk>,
>> Richard Caley <rjc@liddell.cstr.ed.ac.uk> wrote:
>> >Keeping the source secret certainly doesn't prevent piracy. If it did
>> >Microcruft would be immune from piracy rather than being the major
>> >victim.
>>
>> Please consider the group that you are reading this in when you make
>> such statements.
>
>What's your point? Is criticizing M$ taboo in c.l.p.m?
Of course not. The point is, this is comp.lang.perl.misc where the only
way to distribute your program is as source, and thus if you keep the
source secret you do an excellent job of preventing piracy of the
program. Microsoft is not immune to piracy because they release freely
executable binaries, not because of anything to do with source.
>> Yes, keeping the source secret when the source is perl
>> really does help prevent piracy.
Gee, if you had read further, you might not have had to ask.
>> It can't prevent it if one of your
>> contractually obligated to secrecy purchasers decides to violate that
>> obligation, but it will stop people from copying and running your code
>> because they can't just ftp it from everywhere.
>
>A file is a file. People can illegally copy, distribute, make available
>a source code file equally as easily as an executable binary.
Please read the thread before jumping in. Of course you can copy a file,
and nobody has said otherwise. If the code does a license check, then it
is much easier to remove that check from source than from binary.
>If anything,
>source is less prone to piracy because it must undergo some kind of
>transformation before it can be run (compile, link, interpret,
>whatever).
That is a hoot. Please keep in mind the group you are making that
statement in. Hey, you didn't mention M$, either.
>M$ could easily choose to include the source code to their applications
>on
>the CD-ROM. If they did, it would include the same kind of use
>restrictions
>they currently place on the binaries: "Give this stuff to anyone else,
>and,
>we swear to God, you won't know what hit you."
And if they had any applications that were really license protected,
they will have just voided that licensing. Edit the source to remove the
license checks and bingo.
I suppose now you will tell me, like others have, that you can edit the
binary too. And like we have already gone through, yes, some people can,
but most people cannot.
>> >Things I do commercially get supplied with full source because two
>> >years from now I might have gone to live up the Orinoco, and the
>> >people who payed me for a product shouldn't be left up shit creek.
>>
>> That is your choice. Who has said that you can't make such a choice?
>
>More to the point, it is a good choice --
No that is not more to the point. Whether it is a good choice or not is
irrelevant. That it be allowed to be made, and allowing the opposite
choice, is what is relevant -- in this discussion. Code must be free,
but people cannot?
------------------------------
Date: 22 Jan 1998 19:48:07 -0500
From: steveo@panix.com (Steven M. O'Neill)
Subject: Re: space searching?
Message-Id: <6a8pc7$66u@panix2.panix.com>
In article <34C7BC72.5BE8@min.net>, John Porter <jdporter@min.net> wrote:
>Steven M. O'Neill wrote:
>> Please be aware thah using html tags in usenet posts is poor form if not
>> out and out poor taste. And besides, the <sarcasm> tag isn't even
>> supported by lynx.
>
>Hey, I think you forgot your <facetious>,</facetious> tags.
You forgot to mention that I misspelled "that".
--
steveo@panix.com
------------------------------
Date: 23 Jan 1998 00:27:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Unkown Error
Message-Id: <6a8o6e$cj7$5@comdyn.comdyn.com.au>
In article <6a81hl$lga@news-central.tiac.net>,
"Eddy Viscous" <ev@kzed.com> writes:
> Can someone help with an error message I am getting.
> [22/Jan/1998:12:46:45] catastrophe: for host 152.163.232.25 trying to POST
> /employer_db/job_post.cgi, send-cgi reports: could not import pipes into
> security lib (No such file or directory)
This is not a perl error message. There is no perl code for us to
examine. We're not psychic. Please give us some more information.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Thu, 22 Jan 1998 19:08:31 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Wierd error messages??!!
Message-Id: <comdog-ya02408000R2201981908310001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6a8c28$qnb$1@hermes.seas.smu.edu>, "Scott Norris" <snorris@post.cis.smu.edu> posted:
>#!/usr/bin/perl
why isn't that
#!/usr/bin/perl -w
># delete.pl
># deletes the textbook with ID as entered by the user
># form submits the ID with name "IDno"
>
>&getdata
what's missing there?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: 23 Jan 1998 00:03:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Wierd error messages??!!
Message-Id: <6a8mos$cj7$1@comdyn.comdyn.com.au>
In article <6a8c28$qnb$1@hermes.seas.smu.edu>,
"Scott Norris" <snorris@post.cis.smu.edu> writes:
> I get some wierd errors on the following script.
That's a weird word you've got there.
> -string found where operator expected, line 11
read the perlsyn documentation on how to use if
perldoc perlsyn
if (EXPR) BLOCK
Notice the brackets?
> -literal @6 now requires backslash, line 11
you have to make sure that a @ is escaped in perl5, when it is used in
a string context. You will need to look at the quotemeta() function,
or use \Q\E.
perldoc perlre
perldoc -f quotemeta
> -Unrecognized character \310 ignored, line 11
You have crap in $form{IDno}
> -syntax error at line 16, near "}"
See the first point
> I don't understand any of this. Help!!
Help yourself, read some documentation, at least on the stuff you will
be using.
> ----------------------------------------------------------------------
> #!/usr/bin/perl
ALWAYS use the -w flag for perl.
> # delete.pl
> # deletes the textbook with ID as entered by the user
> # form submits the ID with name "IDno"
>
> &getdata
Is this a CGI? use the CGI.pm module. It will prevent a lot of errors
for you.
> open LIST, "+>>/textbook/booklist.csv";
> while (<LIST>) {
> if /$form{IDno}/ {
> s/<LIST>// or die "Can't delete record";
This will not do what you think it does. Read up on the <> operator
perldoc -f open
perldoc perlop
(section I/O operators)
The current line will be stored in $_. <LINE> will just read the next
one, which doesn't even necessarily exist.
> $success = 1;
> last;
> }
Where are you writing? Also read
perldoc perlfaq5
/How do I change one line in a file
> }
I really suggest you read some of the excellent documentation provided
with perl. You should also read a few other articles in this
newsgroup, just to get a feel for the language. Buy a good book
(http://language.perl.com/info/documentation.html).
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 23 Jan 1998 00:26:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Wierd error messages??!!
Message-Id: <6a8o38$cj7$4@comdyn.comdyn.com.au>
Oh, forgot this in the first post:
> open LIST, "+>>/textbook/booklist.csv";
ALWAYS, ALWAYS check the return value of open.
(BTW, why did you post this question twice?)
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 23 Jan 1998 00:17:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Win32 PERL Newbie question
Message-Id: <6a8nja$cj7$3@comdyn.comdyn.com.au>
[Subject: Re: Win32 PERL Newbie question]
Please read the following article on how to choose good subject lines:
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
In article <6a8ar0$8gl@news1.infinet.com>,
badger@infinet.com (Steven Savage) writes:
> Essentially, i wish to be able to type the name of a perl program
> with the .pl extension and have perl.exe run it, passing the command
> line, etc. Unfortunately despite Associating in Explorer, I found
> no way to do this. My own Win32/DOS ignorance I know, but I can
> locate no way to do this.
This really has nothing to do with perl, but is related to your OS.
You should ask this on one of the newsgroups related to your OS.
You should also read the following documents, the answer might be in
there:
http://www.perl.com/CPAN/doc/FAQs/win32/Perl_for_Win32_FAQ.html
http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html
and of course, the documentation that comes with perl.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
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 1709
**************************************