[10834] in Perl-Users-Digest
Perl-Users Digest, Issue: 4435 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 16 03:07:28 1998
Date: Wed, 16 Dec 98 00:00:49 -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 Wed, 16 Dec 1998 Volume: 8 Number: 4435
Today's topics:
Re: $|=0 <jamesht@idt.net>
Re: $|=0 (brian d foy)
Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/) (Emmett McLean)
Re: 3 perl cgi questions... <jamesht@idt.net>
Re: CGI Redirection (Adam Levy)
Re: Complicated sorting problem (Bill Moseley)
Re: Complicated sorting problem <uri@sysarch.com>
Re: Formatting Numbers (Emmett McLean)
Re: Formatting Numbers (brian d foy)
Re: Formatting Numbers (Sam Holden)
Re: Frame question (Tommy1452)
Re: Hashref Compatibility with Perl 4.0 -- TIA (Emmett McLean)
Help with Win32 to Unix Porting expoinfo@globalexpos.co.nz
Re: Help: File size weirdness with db's (Emmett McLean)
How to automate post form submissions to a server that (Tommy1452)
Re: How to automate post form submissions to a server t (brian d foy)
Re: Joined and split arrays (David Combs)
Re: making html change (Emmett McLean)
Re: making html change (brian d foy)
Re: Newbie help plz <jamesht@idt.net>
Re: Personal Web Server, Windows 95-98, Perl. <erlangen72@hotmail.com>
Re: problem with grep and readdir for subdirectories (Emmett McLean)
Re: problem with grep and readdir for subdirectories (brian d foy)
Re: Problem with script "... cgi-bin\signup.pl' script (Emmett McLean)
Re: specify password in a ftp URL? (Emmett McLean)
Re: Trying to get all directories recursively (Emmett McLean)
Re: Use script to send Standard Form Input? <jamesht@idt.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 16 Dec 1998 01:24:52 -0500
From: jamesht <jamesht@idt.net>
To: om7@cyberdude.com
Subject: Re: $|=0
Message-Id: <36775234.B5DACEF3@idt.net>
hi,
I believe that you've got it backwards. If you print $| = 1; in the
beginning of your script, it automatically flushes the buffer without
waiting for further input. This is useful because browsers may timeout if
the buffer's storing all of the info for them, when there's a lot of info
for the script to process.
Hope this helps.
James
------------------------------
Date: Wed, 16 Dec 1998 02:51:45 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: $|=0
Message-Id: <comdog-ya02408000R1612980251450001@news.panix.com>
In article <36775234.B5DACEF3@idt.net>, jamesht <jamesht@idt.net> posted:
> I believe that you've got it backwards. If you print $| = 1; in the
> beginning of your script, it automatically flushes the buffer without
> waiting for further input.
$| doesn't cause buffers to be flushed. it tells perl to flush
buffers after each print. not quite the same thing (as pointed out
earlier this week).
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: 15 Dec 1998 21:37:49 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/)
Message-Id: <757gvd$lpo@slip.net>
Brad Warkentin <bradw@kannews.newbridge.com> wrote:
>
>Then, seriously, it is very broken. "perldoc perlfaq" should give it
>to you. In a decent install "man perlfaq" should work as well.
>The online docs in perl are very very good compared to the norm.
>
Thanks for the help Brad. I can always use a good Perl tip.
>> >And a copy of *that* gets sent to you after your first post to this
>> >group (remember that mail you got?).
>>
>> Huh? How could I remember a mail message I never recieved?
>
>Werid. It gets automailed to all new posters to clpm so unless you post
>without a valid mail address you should have got it.
I have a valid email address but nothing ever came.
>> Absolutely not. If you are not inclined to answer you can pass.
>
>But he did answer. While there is no such thing as a free lunch, you
>can get good answers to a very wide range of questions, ranging from
>faq to details on the internals of the RE engine inside of
>Perl. Why??? Because many of the people who work on developing the
>language and many of the leading experts are willing to answer
>questions. All that is expected of youis that you invest a little
>time and verify that your question is not answered by the online
>documentation or a faq.
Good point.
Thought I'd mention that I do contribute in a positive and significant
way on the internet.
While in college during the years 1993-1995 I contributed a lot on comp.lang.apl.
I integrated the public domain J interpreter with LAPACK - and helped many
many users with questions about J and pointers about how to integrate
the language with C. You're the expert on dejanews, search on mclean.
Infact, due to my posts, my first job out of college was to make additions
and modifications to the J interpreter for a commodities trading firm.
More recently, I'm building a website which will allow users to get
voicemail off the internet - in mp3, wav, au, or snd format - for free.
And if it goes live next february there will be no distracting advertising.
Just a good website.
So, when I get stuck it's because I'm working on that project. So if you help
eventually it may be to your benefit, but if not it will be to the benefit
of some people on the internet. Unfortunately, I also work full time and
I don't have the time to study Perl as seriously as a full time student.
BTW, More recently I've also contributed on the comp.sys.next newsgroups.
>
>No thanks. I very much like having the leading lights available to
>answer questions.
>
If you are geniunely outraged when someone posts a well articulated
simple question your outrage is probably not due to the fact that
a person asked a question that was once asked before. Then you need
to take a breather. That's my view and you may not agree.
Now, when I contributed on comp.lang.apl there was a lot of sad feelings
that APL is/was dying. Some people felt encouraged and pleased to see
that new people were using the language. It didn't matter so much that
you asked a FAQ, it mattered that you were commited to learning J.
You Perl users have it nice. You can disparage new users and amuse
yourselves with a geekness is cool attitude.
>
>Er, you are the one who asked a faq,
Everyone keeps on saying that but my question was not a faq. I did
not ask how to validate an email address, a faq, but rather I asked
a question if minus signs worked with square braces in a special way.
> after failing to check dejanews
>or the online docs that you have to work at to avoid installing when
>the executables are installed (Not that I an suggesting that you
>failed to install Perl properly, but someone certainly did at your site).
>
Amazing. Such a high standard. I supposed it's people like you that
want to impeach Clinton :-) Here in California I don't imagine everyone
is so uptight.
I'm just a guy trying to get help on a project with a limited amount
of time who just learned from you how to read the perl faq. Relax.
>
>I will take correct answers with a tad of grumpyness every time over
>well meaning but wrong answers.
Well over a quarter of the responses here said nothing on Perl and
were very heavy on the grumpyness.
>>
>> I've noted this isn't the only thread where new users have been discouraged
>> from posting and disparaged.
>
>Perhaps you should take a deep breath, deal with the attitude problem
>and then come back. People are _never_ discouraged from asking
>questions if they give an indication that they tried to find the
>answer.
After this experience I certainly am.
On comp.lang.apl people would post a solution to a problem and several
people would contribute more efficent solutions as a way to display mastery
of the language.
Here if I posted my code here, asking for any obvious tips which might
improve performance, based on my recent experience, I'd get 5 sentences
of Perl comments and 500 lines of read the FAQ.
Don't get me wrong, I agree it is good to point people to the FAQ. But
this newsgroup has a more than a few people who seem to prefer scolling
to writing about Perl.
Here it is religous. I recieved two very bitter emails and one friendly email
saying I've got it right.
That's my experience so far. comp.programmer.unix has about the right mix.
You guys could learn from them.
OTOH, answers to faqs are often in the form of references to
>the docs, with the hope that people will rtfm before posting. This
>seems to upset some people who think it is there right to get spoonfed
>answers to faqs.
>
Funny, I spent 4 years tutoring mathematics and I found that
for people geniunely interested in learning, spoon feeding them FAQs
didn't bother me. I enjoyed it. That must just be me. Looking back on it
I learned more by answering those questions than I did by going to class.
When I studied CS I was a lab rat who helped other students with UNIX
fundamentals. To each his own I guess.
Emmett
------------------------------
Date: Wed, 16 Dec 1998 01:33:55 -0500
From: jamesht <jamesht@idt.net>
To: "Christian H. Knudsen" <chrknudsen@hotmail.com>
Subject: Re: 3 perl cgi questions...
Message-Id: <36775452.EF781BC5@idt.net>
Hi,
1) yes, it's possible, but you'll have to open a socket to a)get the
file or b)call a script on that server which will return the size. To
learn how to do this, get the book "Perl Cookbook", and you'll be up and
running in about 5 minutes.
2) yes. here's a handy little sub:
sub gifsize {
local ($gif) = @_;
local ($w, $w2, $h, $h2, $gifwidth, $gifheight, $type) = ();
open (GIF, $gif); read (GIF, $type, 3);
seek (GIF, 6, 0); read (GIF, $w, 1);
read (GIF, $w2, 1);
$width = ord ($w) + ord ($w2) * 256;
read (GIF, $h, 1) ; read (GIF, $h2, 1);
$height = ord ($h) + ord ($h2) * 256;
close (GIF);
return ( $width , $height, $type );
}
Of course it only works with gifs. There are modules on cpan which will
help you with other file types.
3) just add a blank line ("\n\n") after the "Location: blah" line, and
that will tell the browser that that's the end of the headers.
Hope this helps.
James
------------------------------
Date: Tue, 15 Dec 1998 23:24:38 -0600
From: adrade@wwa.com (Adam Levy)
Subject: Re: CGI Redirection
Message-Id: <adrade-1512982324380001@pool2-037.wwa.com>
In article <753m26$2p5$1@gellyfish.btinternet.com>, Jonathan Stowe
<gellyfish@btinternet.com> wrote:
> On Mon, 14 Dec 1998 00:06:51 -0600 Adam Levy <adrade@wwa.com> wrote:
> >
> > Two good ways:
> >
> > 1. With Perl:
> > ------------
> > #!/usr/local/bin/perl
> >
> > $newpage = "http://www.perl.org/";
> > print "$newpage\n\n";
> > 1;
> > ------------
>
> I'll assume you meant
>
> print "Location: $newpage\n\n";
>
Yeah, that's a big whoops. Everyone, take Jon's advice.
------------------------------
Date: 16 Dec 1998 05:52:21 GMT
From: moseley@best.com (Bill Moseley)
Subject: Re: Complicated sorting problem
Message-Id: <36774a95$0$223@nntp1.ba.best.com>
In article <x7n24opzl6.fsf@sysarch.com>, uri@sysarch.com says...
>because this does the regex match for each comparison which will lead to
>cpu death.
Thanks for setting me right. I just ran a test benchmark on my P133 and
my sort routine took over three times longer than the ST.
Still seems to me that you would want to build an array of references to
the data instead of copying each time, especially if the records were large.
But obviously the memory copy is something the cpu does quite well.
Thanks for the education.
--------------
Bill Moseley
moseley@best.com
------------------------------
Date: 16 Dec 1998 01:10:41 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Complicated sorting problem
Message-Id: <x7emq0pqfy.fsf@sysarch.com>
>>>>> "BM" == Bill Moseley <moseley@best.com> writes:
BM> Still seems to me that you would want to build an array of
BM> references to the data instead of copying each time, especially if
BM> the records were large. But obviously the memory copy is
BM> something the cpu does quite well.
try it out and post your results. there are many ways to speed up sorts
as i said. various data sets respond to various tricks. some are best
converted to strings and using perl's builtin sort, some work well with
ST and others with OM (orciam manouever which is not mentioned as much
as ST but is very useful too).
several of us are slowly working on an article for TPJ on perl sort
techniques. look for it before your cpu dies from overwork. :-)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 15 Dec 1998 23:11:13 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: Formatting Numbers
Message-Id: <757meh$qj3@slip.net>
In article <756sjn$edn@bgtnsc02.worldnet.att.net>,
Scott Phillips <scott@reflector.net> wrote:
>Lets say I have:
>
>$amount = "100230.00";
>
>how can I format it so that it places a "," after every third digit to the
>left of the decimal point.....so it would like this:
>
>100,230.00
>
>Thanks, its been stumping me.
>-Scott
>
>
The Perl guru's are going to be really annoyed!!!
I don't have the time to translate the C to Perl
but it can be translated and does what you want.
Emmett
char *ftoaComma(double d) {
char *s;
s = (char *) malloc(sizeof(char) * 20);
if (d<0) {
d*=-1;
sprintf(s,"-");
} else
sprintf(s,"");
if (d>=1000000)
sprintf(s,"%s%.0f,%03.0f,%03.0f",s,
floor(d/1000000),
floor(d/1000)-floor(d/1000000)*1000,
floor(d) - floor(d/1000)*1000);
else if (d>=1000)
sprintf(s,"%s%.0f,%03.0f",s,
floor(d/1000),
floor(d) - floor(d/1000)*1000); /*floor((d-floor(d))*100));*/
else if (d>=1)
sprintf(s,"%s%.0f",s,floor(d));
else
sprintf(s,"0");
return s;
}
------------------------------
Date: Wed, 16 Dec 1998 02:46:10 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Formatting Numbers
Message-Id: <comdog-ya02408000R1612980246100001@news.panix.com>
In article <757meh$qj3@slip.net>, emclean@slip.net (Emmett McLean) posted:
> In article <756sjn$edn@bgtnsc02.worldnet.att.net>,
> Scott Phillips <scott@reflector.net> wrote:
> >Lets say I have:
> >
> >$amount = "100230.00";
> >
> >how can I format it so that it places a "," after every third digit to the
> >left of the decimal point.....so it would like this:
> >
> >100,230.00
> >
> >Thanks, its been stumping me.
> >-Scott
> The Perl guru's are going to be really annoyed!!!
> I don't have the time to translate the C to Perl
> but it can be translated and does what you want.
why post a bunch of C code when there is Perl code in the
FAQ? in perlfaq5 you'll find the answer to
How can I output my numbers with commas added?
which is a lot simpler than your solution.
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: 16 Dec 1998 07:50:02 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Formatting Numbers
Message-Id: <slrn77epha.l27.sholden@pgrad.cs.usyd.edu.au>
On 15 Dec 1998 23:11:13 -0800, Emmett McLean <emclean@slip.net> wrote:
>In article <756sjn$edn@bgtnsc02.worldnet.att.net>,
>Scott Phillips <scott@reflector.net> wrote:
>>Lets say I have:
>>
>>$amount = "100230.00";
>>
>>how can I format it so that it places a "," after every third digit to the
>>left of the decimal point.....so it would like this:
>>
>>100,230.00
>>
>>Thanks, its been stumping me.
>>-Scott
>>
>>
>
>The Perl guru's are going to be really annoyed!!!
A little annoyed because it is a FAQ yes...
>
>I don't have the time to translate the C to Perl
>but it can be translated and does what you want.
>
>Emmett
>
>
>char *ftoaComma(double d) {
> char *s;
> s = (char *) malloc(sizeof(char) * 20);
> if (d<0) {
> d*=-1;
> sprintf(s,"-");
> } else
> sprintf(s,"");
>
> if (d>=1000000)
> sprintf(s,"%s%.0f,%03.0f,%03.0f",s,
> floor(d/1000000),
> floor(d/1000)-floor(d/1000000)*1000,
> floor(d) - floor(d/1000)*1000);
> else if (d>=1000)
> sprintf(s,"%s%.0f,%03.0f",s,
> floor(d/1000),
> floor(d) - floor(d/1000)*1000); /*floor((d-floor(d))*100));*/
> else if (d>=1)
> sprintf(s,"%s%.0f",s,floor(d));
> else
> sprintf(s,"0");
> return s;
>}
A lot annoyed now since you solution doesn't scale well (what about
d>1000000000?), and is overly compicated and thus hard to maintain.
It would be much better to refer the person to the FAQ. If you must answer the
question here and now then at least copy the solution from the FAQ...
sub commify {
local $_ = shift;
1 while s/^(-?\d+)(\d{3})/$1,$2/;
return $_;
}
Now which code would you rather maintain (assuming of course you have a
passing knowledge of regular expressions).
For an explanation of why /g can't be used see perlfaq5.
If I had asked the above question I would much prefer to be refered to the
FAQ where I can find an answer that has much more chance of being correct and
efficient in perl. You seem to think that giving your solution which might
be brilliant in C, but is not so crash hot in perl is doing people a favour.
I would prefer to show people how to find the answer themselves instead of
having to wait for news turnaround times and for you to be awake. That way next
time they have different question they will try the obvious which in this case
was :
perldoc -q comma
--
Sam
"... 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: 16 Dec 1998 05:43:19 GMT
From: tommy1452@aol.com (Tommy1452)
Subject: Re: Frame question
Message-Id: <19981216004319.07084.00006272@ng-ft1.aol.com>
Try this
Put this code in frame2.html
<SCRIPT>
document.form[0].target=frame1name(whatever it is)
</SCRIPT>
------------------------------
Date: 15 Dec 1998 23:08:05 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: Hashref Compatibility with Perl 4.0 -- TIA
Message-Id: <757m8l$qcb@slip.net>
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>> I have the need to write perl scripts using only verion 4.0. There
>> are many reasons that I can not use a current version. Here is the
>> exact version of perl I'm using --
>
>you may say that, but I cannot think of one single reason that you
>cannot upgrade to perl 5. I can think of many many reasons why you
>should.
Well for one, he might not be the sys admin on the machine.
>Use a comma (,) instead.
Someone already suggested that.
>If you _have_ to use perl 4, you should consult the perl 4
>documentation, and maybe see if you can find a book about it. You'll
>find fewer and fewer people here who remember enough about perl4 to
>assist you beyond simple questions like this.
>
Some people just like to grump.
>Martien
>--
------------------------------
Date: Wed, 16 Dec 1998 04:55:06 GMT
From: expoinfo@globalexpos.co.nz
Subject: Help with Win32 to Unix Porting
Message-Id: <757efa$joq$1@nnrp1.dejanews.com>
Hi,
I have the following part of a script...
I have Ported before, and find it usually a piece of cake, but this current
script boggles me... Have a look
print qq!
<html>
<title>Search Results for $search</title>
<body bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" width="550">
<tr>
<td valign="top" width="450">
!;
and i have ported it to this..
print ("<html>\n<body>\n<table border=\"0\" cellpadding=\"0\"
cellspacing=\"0\" width=\"550\"><tr><td valign=\"top\" width=\"450\">");
Please Tell me What is wrong with the porting.. ans it seems to just block out
after body.. and not do anything...
Thanks
Drew
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 15 Dec 1998 23:12:09 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: Help: File size weirdness with db's
Message-Id: <757mg9$qle@slip.net>
In article <7573vf$ojl$1@nntp.Stanford.EDU>,
Perry Friedman <friedman@Xenon.Stanford.EDU> wrote:
>
>
>Furthermore, if I "cp" the file, the new file behaves normally wrt to du
>and df -k.
>
What about du -k -s ?
Emmett
------------------------------
Date: 16 Dec 1998 05:31:57 GMT
From: tommy1452@aol.com (Tommy1452)
Subject: How to automate post form submissions to a server that sets cookies?
Message-Id: <19981216003157.07084.00006269@ng-ft1.aol.com>
Can I use perl to retrieve information from a server that uses cookies?
thomashooper@hotmail.com
------------------------------
Date: Wed, 16 Dec 1998 01:30:17 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to automate post form submissions to a server that sets cookies?
Message-Id: <comdog-ya02408000R1612980130170001@news.panix.com>
In article <19981216003157.07084.00006269@ng-ft1.aol.com>, tommy1452@aol.com (Tommy1452) posted:
> Can I use perl to retrieve information from a server that uses cookies?
yes.
use LWP;
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: Wed, 16 Dec 1998 05:33:28 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Joined and split arrays
Message-Id: <dkcombsF41M3s.64E@netcom.com>
In article <kiqo47.802.ln@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>Brad McBride (Brad.McBride@Axom.com) wrote:
>
>: I've just run into a problem that I'm not too sure how to fix.
>: According to my documentation, this should work. I have an array called
>: @openticketlist which is full of information (any number of rows) from
>: an oracle database. I have joined all of the information from the
>: database in this array using ':' as the delimiter. I then am trying to
>: get each individule piece of information out of that array by putting it
>: into another array called @opentickets. Here is how I am doing it:
>
>: @opentickets = split(/:/, @openticketlist);
>
>: When I print out the contents of @openticketlist, I see all of my
>: information, nicely seperated by :s. When I print out my split array,
>: instead of seeing the same information formated differently, I get the
>: number 6. That's it, just the number 6. Is there something I am screwing
>: up with the split function or am I going about this all the wrong way?
>
>
> You are going about this the wrong way.
>
> split() wants a _string_ as the second argument. You have
> given in a list.
...
Do not these things *check* their args? Or am I missing
something basic -- the answer to which we could all benefit
from?
(Sorry for insane posts of a week ago.)
David
------------------------------
Date: 15 Dec 1998 23:00:17 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: making html change
Message-Id: <757lq1$q07@slip.net>
In article <3676EC6C.7F7B1922@utig.ig.utexas.edu>,
>
>What I have is a directory full of html files. I would like to search
>for the names of
>these files in a html document I specify. When I find a match, I would
>like to change
>the text to an href pointing to the html file it corresponds to.
>
I'd recommend you find fgres from the comp.unix.sources archive.
Then you could type :
fgres "http://url1.com" "http://url2.com" *.html
That would change all occurances of "http://url1.com" to http://url2.com"
in all your html files.
Also, if the urls differ because one url is for development
and another is for production you might consider using
serverside includes for the url references. That way you don't
even have to modify the files.
Emmett
------------------------------
Date: Wed, 16 Dec 1998 02:49:52 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: making html change
Message-Id: <comdog-ya02408000R1612980249520001@news.panix.com>
In article <757lq1$q07@slip.net>, emclean@slip.net (Emmett McLean) posted:
> I'd recommend you find fgres from the comp.unix.sources archive.
>
> Then you could type :
>
> fgres "http://url1.com" "http://url2.com" *.html
why waste all that time looking for something that perl can already
do?
perl -pi.old -e 's|http://url1\.com|http://url2.com|g" *.html
perhaps you just forgot which newsgroup you were in.
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: Wed, 16 Dec 1998 01:46:49 -0500
From: jamesht <jamesht@idt.net>
To: clemenr@westminster.ac.uk
Subject: Re: Newbie help plz
Message-Id: <36775759.28A73470@idt.net>
Hi,
I think that the system(ls) call won't work because NT doesn't understand
the ls command.
how's this for a solution:
opendir(DIR, "$the_dir") || die "$!";
while($dir = readdir(DIR)) {
# do stuff to each thing in $dir.
}
closedir(DIR);
Something like this should work fine,
James
------------------------------
Date: Tue, 15 Dec 1998 21:43:59 -0800
From: "ErLanGen" <erlangen72@hotmail.com>
Subject: Re: Personal Web Server, Windows 95-98, Perl.
Message-Id: <757hje$nv7$1@ash.prod.itd.earthlink.net>
Hi Adam,
Yes it's possible. I have MS PWS4 and Win95b, IE4.01 sp1.
This is a Perl related question. PWS4 supports all the bells and
whistles offered by PerlScript. However, PWS4 will slightly cripple
your installation if you don't have WInNT.
You will need to make PerlScript your default ASP Script Engine.
To do this you need to have the following Registry Fix:
================snip====================
REGEDIT4
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\ASP]
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\_
Services\W3SVC\ASP\LanguageEngines]
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\_
Services\W3SVC\ASP\LanguageEngines\PerlScript]
"Write"="$Response->write(|);"
"WriteBlock"="$Response->writeblock(|);"
====================snip=====================
As a minimum, this Registry fix will allow you to view all the
Perl HTML help with your Web Server. Set up web sharing
in your Perl folder and you will be surprised to see how nicely
all the samples will run.
HTH, Mark
Adam Michela wrote in message ...
>Anyone know if it is possible to set up personal web server with perl on a
>windows95, or 98 system, I see alot of references about it. But I see
>nothing telling you how.
>
>Any help would be appreciated, thank you.
>
>Adam Michela
>
>
>
------------------------------
Date: 15 Dec 1998 23:04:01 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: problem with grep and readdir for subdirectories
Message-Id: <757m11$q5q@slip.net>
In article <xbEd2.99$595.86@nsw.nnrp.telstra.net>,
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>
>Please, please, please, always consult the documentation first if you
>have a problem with a certain function.
>
As is typical in this group, don't give any answers and
wine that the answer is in the documentation.
Gees.
I'd recommend you get a find command which works for you on
the unix command line and use qx. As in
@mydirs = qx/find rootdir -type d (blah blah blah)/;
Emmett
------------------------------
Date: Wed, 16 Dec 1998 02:47:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: problem with grep and readdir for subdirectories
Message-Id: <comdog-ya02408000R1612980247400001@news.panix.com>
In article <757m11$q5q@slip.net>, emclean@slip.net (Emmett McLean) posted:
> @mydirs = qx/find rootdir -type d (blah blah blah)/;
for someone interested in Perl you don't seem to like using it
very much. might as well use sh if you are going to do that.
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: 15 Dec 1998 23:15:10 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: Problem with script "... cgi-bin\signup.pl' script produced no output "
Message-Id: <757mlu$qqj@slip.net>
In article <19981215212234.15592.00003761@ng-fi1.aol.com>,
CareerMngr <careermngr@aol.com> wrote:
>Problem with script "... cgi-bin\signup.pl' script produced no output "
>
>Any ideas why a perl script installed to a NT server might produce the above
>error message (or know someone who can help me)? I've installed the scripts
>more than a dozen times to UNIX and freebsd servers without a problem.
>
Could be a confirguration problem associated with your server.
I'm not familiar with IS 4.0 but with Suitespot and Apache there
is a way to define a cgi-bin directory so that when the statement
http://yoururl.com/cgi-bin/yourscript.pl
is executed the server knows where to find yourscript.pl.
So, unless the script is doing something NT can't do, that is probably
the source of the problem.
Emmett
------------------------------
Date: 15 Dec 1998 23:19:17 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: specify password in a ftp URL?
Message-Id: <757mtl$quu@slip.net>
Just a related comment.
You can require usernames and passwords via your
webserver. That way you don't have to manage things
with your code. Also, it will be harder for hackers
to mimic your code by experimenting with the parameters
to your url.
BTW, it is possible to manage usernames and passwords
through your server with msql. Code is available to
integrate htaccess with a msql database.
Cheers,
Emmett
------------------------------
Date: 15 Dec 1998 22:56:31 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: Trying to get all directories recursively
Message-Id: <757liv$pqg@slip.net>
Try using find2perl on your find statement.
Sometimes that will return perl code which you
can edit.
Here's an example :
Suppose you want to get a list of all files with
the string "Perl wizards are grumps ". Then you'd type
find . -type f -exec grep -l "Perl wizards are grumps" "{}" ";"
So find2perl then returns :
#!/usr/local/bin/perl
eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
require "find.pl";
# Traverse desired filesystems
&find('find','.');
exit;
sub wanted {
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
-f _ &&
&exec(0, 'grep','-l','Perl wizards are grumps','{}');
}
sub exec {
local($ok, @cmd) = @_;
foreach $word (@cmd) {
$word =~ s#{}#$name#g;
}
if ($ok) {
local($old) = select(STDOUT);
$| = 1;
print "@cmd";
select($old);
return 0 unless <STDIN> =~ /^y/;
}
chdir $cwd; # sigh
system @cmd;
chdir $dir;
return !$?;
}
So you can see how you might edit the part with the grep.
.....
Then there is also the obvious :
@findresult = qx/find . -type f -exec grep -l \"Perl wizards are grumps\" \"{}\" \";\"/;
Emmett
------------------------------
Date: Wed, 16 Dec 1998 01:16:31 -0500
From: jamesht <jamesht@idt.net>
To: jday@microcal.com
Subject: Re: Use script to send Standard Form Input?
Message-Id: <3677503F.521E55E7@idt.net>
Julie,
You can use a javascript to submit a form an the new page like so:
<html><body onload="document.forms[0].submit();">
<form action="script.cgi">
<input type="hidden" name="this" value="that">
<input type="hidden" name="the" value="other">
</form></body></html>
I hope this helps.
James
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4435
**************************************