[9780] in Perl-Users-Digest
Perl-Users Digest, Issue: 3373 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 6 06:06:36 1998
Date: Thu, 6 Aug 98 03:00:21 -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 Thu, 6 Aug 1998 Volume: 8 Number: 3373
Today's topics:
Re: -- Can One Perl Script call another one? (-)
Re: But what about "baz"? (Was: "foo" and "bar") <rra@stanford.edu>
Calling next from sub (Patrick Clauberg)
Re: Calling next from sub <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Can I compile a perl script in Perl for Win32? <jwb79@mail.idt.net>
Re: can you un encrypt htpasswd? (-)
Re: comp.lang.perl.announce redux <rra@stanford.edu>
Re: comp.lang.perl.announce redux <jimbo@soundimages.co.uk>
Re: comp.lang.perl.announce redux birgitt@minivend.com
Re: Executing a Perl script from a hyperlink <rra@stanford.edu>
Re: Executing a Perl script from a hyperlink (-)
help a newbie, please! <j9feng@hotmail.com>
Re: hiding user input no.unsoliciteds@dead.end.com
Installing Additional Packages in ActivePerl <pep_mico@hp.com>
NaN <terdoest@cs.utwente.nl>
Re: op/rand test problem on SunOS 5.5.1 <rra@stanford.edu>
Re: perl 5.005: Binary Distribution for Win32? <pep_mico@hp.com>
Re: Perl Docs.. forget the original post no.unsoliciteds@dead.end.com
Re: Perl Docs.. forget the original post <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: perlfaq - frequently asked questions about Perl (pa no.unsoliciteds@dead.end.com
Re: Premature end of script headers & Exec format error <quednauf@nortel.co.uk>
Re: rename problem <rra@stanford.edu>
Re: Retrieving file from REMOTE_ADDR ... HELP! <dgris@rand.dimensional.com>
Re: Retrieving file from REMOTE_ADDR ... HELP! (-)
Re: Retrieving file from REMOTE_ADDR ... HELP! <flavell@mail.cern.ch>
Re: setting a password on a linux system via cgi..... (Randy Kobes)
Re: Single word ouptu from aa array <quednauf@nortel.co.uk>
Re: socket problem <rra@stanford.edu>
Re: split & empty patterns <adam@fastfare.co.uk>
Re: X-file (?=...), case postponed. <quednauf@nortel.co.uk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 06 Aug 1998 03:23:59 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: -- Can One Perl Script call another one?
Message-Id: <35c921b4.51688359@news2.cais.com>
comdog@computerdog.com (brian d foy) Said this:
>In article <35C75127.F1B@yeahright.net>, Webcruiser <kamenar@yeahright.net> posted:
>
>it seems easier to steal from Tom to answer this question, especially
>since this is the same answer he gave to you when you asked before.
>the answers don't change no matter how many times you ask.
But the question changes a little each time! :)
------------------------------
Date: 05 Aug 1998 23:13:29 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: But what about "baz"? (Was: "foo" and "bar")
Message-Id: <m3sojar62e.fsf@windlord.Stanford.EDU>
Jon Bell <jtbell@presby.edu> writes:
> I've probably seen the "foobar" etymology as often as anyone else in
> this group, I guess, but I still don't know where "baz" came from. You
> don't see "baz" as often as "foo" and "bar", but it occurs often enough
> in connection with the other two that there must be a story behind it.
The Jargon File is your friend. <URL:http://www.ccil.org/jargon/>
:baz: /baz/ n. 1. The third {metasyntactic variable} "Suppose we have
three functions: FOO, BAR, and BAZ. FOO calls BAR, which calls
BAZ...." (See also {fum}) 2. interj. A term of mild annoyance. In this
usage the term is often drawn out for 2 or 3 seconds, producing an
effect not unlike the bleating of a sheep; /baaaaaaz/. 3. Occasionally
appended to {foo} to produce `foobaz'.
Earlier versions of this lexicon derived `baz' as a Stanford corruption
of {bar}. However, Pete Samson (compiler of the {TMRC} lexicon)
reports it was already current when he joined TMRC in 1958. He says
"It came from "Pogo". Albert the Alligator, when vexed or outraged,
would shout `Bazz Fazz!' or `Rowrbazzle!' The club layout was said to
model the (mythical) New England counties of Rowrfolk and Bassex
(Rowrbazzle mingled with (Norfolk/Suffolk/Middlesex/Essex)."
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 06 Aug 1998 07:23:42 GMT
From: pat@uni.de (Patrick Clauberg)
Subject: Calling next from sub
Message-Id: <35c9588e.3493270@news.nef.wh.uni-dortmund.de>
Hi everybody,
this is my problem;
I have an array @array and do a
foreach $var (@array) {
$var2 = `some command($var)` ;
}
the command thing might hang and after a couple of seconds with no
response, a timeout sub is being called.
What I want to do is changing to the next $var , so It might looke
like
sub timeout{
next;
}
Unfortunately it does not seem to be possible do call the next from
within a sub.
Does anybody know a way to "remote control" the foreach thing?
Thanx
Patrick
------------------------------
Date: 06 Aug 1998 10:16:12 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Calling next from sub
Message-Id: <7x4svq4jar.fsf@fidelio.vcpc.univie.ac.at>
Re: Calling next from sub, Patrick <pat@uni.de> said:
Patrick> Hi everybody, this is my problem;
Patrick> I have an array @array and do a
Patrick> foreach $var (@array) { $var2 = `some
Patrick> command($var)` ; }
Patrick> the command thing might hang and after a couple of
Patrick> seconds with no response, a timeout sub is being
Patrick> called.
It looks like you need to set up an alarm with an
appropriate handler.
perldoc -f alarm
perldoc -f eval
perldoc -f die
perldoc perlipc
Another way involves open() and select() to poll a
filehandle with a timeout.
TAOWODI.
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: 6 Aug 1998 06:58:34 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: Can I compile a perl script in Perl for Win32?
Message-Id: <01bdc107$c7a8eb30$6488fdc7@dixon>
: I want to compile a perl script into native image(EXE)
: which can than be executed under WIN95/WINNT system.
:
: Question:
: 1) Can I compile a perl script by Perl for WIN32?
:
: 2) IF YES, what is the procedure to compiler the Perl Script?
:
1) Yup
2) look at http://www.demobuilder.com/perl2exe.htm
regards
------------------------------
Date: Thu, 06 Aug 1998 03:45:07 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: can you un encrypt htpasswd?
Message-Id: <35c926af.52964047@news2.cais.com>
stan zylowski <stanz@en.com> Said this:
>can you un encrypt htpasswd file for those that forget it?
NOPE.
Root can change their password though.
------------------------------
Date: 05 Aug 1998 22:56:23 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: comp.lang.perl.announce redux
Message-Id: <m31zquslfc.fsf@windlord.Stanford.EDU>
Damien SAUTEREAU <dsautereau@magic.fr> writes:
> I guess clpa has no equivalent in any other Perl's hierarchy. So if it
> has an international audience we should expect and accept non-english
> posting. Accepting only posts in English means refusing potentialy good
> Perl programming announcements. Personnaly I don't read clp* for
> English language but for Perl language.
I don't know if anyone has pointed this out yet, but....
de.comp.lang.perl
fj.comp.lang.perl
fr.comp.lang.perl
han.comp.lang.perl
it.comp.lang.perl
no.it.programmering.perl
relcom.comp.lang.perl
would seem to be the appropriate places to post articles about Perl in
German, Japanese, French, Korean, Italian, Norwegian, and Russian.
It's worth keeping in mind that, except for soc.culture.* which has its
own rules, the Big Eight including comp.* are the de facto world-wide
*English* hierarchy and really should be under en.*. They aren't pretty
much solely for historical reasons.
While this is not to say that posts in other languages should be banned,
it does indicate that if someone is writing *primarily* in another
language, they'd be better served in a different hierarchy. For one
thing, all administrative business in the Big Eight related to newsgroup
creation is done exclusively in English because the news administrators
that carry these hierarchies have English in common more than any other
language, so people using other languages will eventually find that they
cannot easily participate in debate surrounding creating, removing, or
renaming the groups they're reading here.
Please also keep in mind that such hierarchies as de.* are often not
regional hierarchies, but rather are chartered as *world-wide* hierarchies
in the languages in question.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 06 Aug 1998 08:23:29 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: comp.lang.perl.announce redux
Message-Id: <uogtyzi8e.fsf@jimbosntserver.soundimages.co.uk>
abigail@fnx.com (Abigail) writes:
> Are 2 non-English postings a year such a big deal?
It would appear that they are a big deal. Otherwise, much of the
content, as well as the tone, of this thread would never have been
generated.
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: Thu, 06 Aug 1998 09:02:16 GMT
From: birgitt@minivend.com
Subject: Re: comp.lang.perl.announce redux
Message-Id: <6qbren$uov$1@nnrp1.dejanews.com>
In article <ltd8afzp1b.fsf@asfast.com>,
Lloyd Zusman <ljz@asfast.com> wrote:
> Jim Brewer <jimbo@soundimages.co.uk> writes:
>
> > fl_aggie@thepentagon.com (I R A Aggie) writes:
> >
> > > Notice, tho, that the Camel wasn't translated into English.
> >
> > I noticed that as well. I have also noticed very few Perl books
> > translated into English. I wonder why that is? No lack of demand
> > then.
No, more a lack of quality Perl books written in languages other
than English in the first place.
But there are some and if they are good enough, they are either
immediately written in English by authors whose native language
is not English, or they are considered good enough to be picked up
by publishers in the English spoken countries and translated.
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 05 Aug 1998 23:28:54 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Executing a Perl script from a hyperlink
Message-Id: <m3hfzqr5cp.fsf@windlord.Stanford.EDU>
Rick Ryan <rickryan@mindspring.com> writes:
> I have a page that has an <img=> command that points back to a gif
> file. Is there any way to make it point to and execute a perl script
> (without a submit form)?
Yes, probably, although this is a CGI question and not a Perl question and
therefore would be better in comp.infosystems.www.authoring.cgi. You can
set the src attribute of the <img> tag to point at a CGI script, provided
that CGI script returns a graphic.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 06 Aug 1998 04:42:48 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Executing a Perl script from a hyperlink
Message-Id: <35c933f6.56354303@news2.cais.com>
"Rick Ryan" <rickryan@mindspring.com> Said this:
>I have a page that has an <img=> command that points back to a gif file. Is
>there any way to make it point to and execute a perl script (without a
>submit form)?
>
>
Yes.
<img src="http://www.yourserver.com/cgi-bin/perl.pl">
or if you have some information you'd like to pass to it:
<img
src="http://www.yourserver.com/cgi-bin/perl.pl?foo=foodata&bar=bardata">
------------------------------
Date: Thu, 06 Aug 1998 03:41:51 -0500
From: Jianjun Feng <j9feng@hotmail.com>
Subject: help a newbie, please!
Message-Id: <35C96C4F.717A4F0D@hotmail.com>
I am running a server(Apache) on my Win95. Perl is installed in C:\Perl
directory.
I borrowed a very simple perl script and tried to use it in my server.
The first line in the script is written for unix system: something like
" #!/usr/bin/perl". How can i do the same thing for win95, or can i do
it in win95 at all?
If I could make the simplest thing done, I will have a good chance to
learn the real perl things. But the problem is where I shall start
from?
Help me to make my first step straight
Thank you
Jianjun Feng.
------------------------------
Date: Thu, 06 Aug 1998 16:33:31 +0900
From: no.unsoliciteds@dead.end.com
Subject: Re: hiding user input
Message-Id: <35C95C4C.E9A7EB80@dead.end.com>
Greg Bacon wrote:
>
> The moderated group doesn't replace this group! Being a *.misc group
> makes it the catchall for topics related to Perl that don't quite fit
> in the other groups (or topics for which no one can agree on the proper
> group). This group is not obsolete. This group still needs to be
> useful. FAQ flooding and usefulness are forces in opposing directions.
Again you contradict yourself in a post Greg - if misc means the group is to
cover topics that don't fit in the other perl groups please tell me where
comp.lang.perl.newbies or comp.lang.perl.faq are. If these news groups don't
exist then where should the topics that would have gone to them go?
AS you are one of a small group who seems to have a problem - why don't you
and the small group go off where you'll be happier - like comp.lang.perl.misogenist
------------------------------
Date: Thu, 06 Aug 1998 09:00:31 +0200
From: Pep Mico <pep_mico@hp.com>
Subject: Installing Additional Packages in ActivePerl
Message-Id: <35C9548E.D29D32B2@hp.com>
Hello everybody
I'm suffering problems with a module named ppm.pl that installs
additional packages in the latest distribution of Perl provided by
ActiveState.
Now with this release packages must be installed using an script named
PPM.PL that downloads it from activestate. This Script doesn't run in my
Network configuration.
Does anybody knows how can I download it the packages that I need?
regards
pep_mico@hp.com
------------------------------
Date: Thu, 06 Aug 1998 09:59:54 +0200
From: Hugo ter Doest <terdoest@cs.utwente.nl>
Subject: NaN
Message-Id: <35C9627A.F8B39D73@cs.utwente.nl>
Hi all,
is it possible to trap the creation of an NaN? Another possibility
would be to check each and every math operation that may result in NaN
I'm doing, but that's more work than setting up an error trap.
Does the creation of an NaN depend on the particular math library I have
or the architecture (Solaris in my case)?
Hugo
------------------------------
Date: 05 Aug 1998 23:27:33 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: op/rand test problem on SunOS 5.5.1
Message-Id: <m3k94mr5ey.fsf@windlord.Stanford.EDU>
Martien Verbruggen <mgjv@comdyn.com.au> writes:
> "Scott A Baxter" <sbaxter@c031.aone.net.au> writes:
>> I am trying to install perl 5.003 on SunOS 5.5.1 and I find that when I
>> run the make test op/rand fails on test2.
> Take my advice: Don't install 5.003. get the latest, which is perl
> 5.005_01, or maybe even 5.005_02 by the time you read this.
I'd recommend waiting for 5.005_02; 5.005_01 has a few bugs. Still using
5.004_04 here.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 06 Aug 1998 08:54:45 +0200
From: Pep Mico <pep_mico@hp.com>
Subject: Re: perl 5.005: Binary Distribution for Win32?
Message-Id: <35C95335.E1A66D30@hp.com>
Go to www.activestate.com
Michael Schilli wrote:
> Hi 5.005 gurus,
>
> I understand 5.005 compiles well on Win32 - but since I don't have a C
> Compiler on my Windows box: is there a binary distribution for Win32?
>
> Thanks,
>
> -- Michael
>
> ----------------------------------------------------------
> Michael Schilli http://perlmeister.com
> ----------------------------------------------------------
------------------------------
Date: Thu, 06 Aug 1998 18:18:21 +0900
From: no.unsoliciteds@dead.end.com
Subject: Re: Perl Docs.. forget the original post
Message-Id: <35C974DF.B1AC1CEA@dead.end.com>
Jaime Metcher wrote:
>Essentially, they are writing it for themselves and people like them, as a
way to express and share >the depth and breadth of their knowledge. They
don't have "useability" departments doing random
>tests on Joe Average to see if he understands. They don't care about that
and there's no reason why > they should.
All I can say is this - if the gurus had had bad tempered, ecclectic, obtuse
and sometimes downright abusive lecturers with bad communication skills
perhaps they would have a different attitude now. They don't care, you're
right, but if they don't then why are they writing documentation that is
supposed to expalain something. If I keep speaking at you in Chinese you're
going to learn something after a while (not)- Well the QURGE function is just
like the C QURGE. Great, so do I have to learn C just so I can understand
what the function does? Or UNIX, or AWK, or SED, or SHELL? Don't get me wrong
I dislike people who try to get me to think for them just as much as the next
user, but these references are just as lazy, because they make me think for
whoever wrote it, because they couldn't be bothered finding a better way of
saying it.
------------------------------
Date: 06 Aug 1998 11:31:46 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Perl Docs.. forget the original post
Message-Id: <7x3eba4fst.fsf@fidelio.vcpc.univie.ac.at>
Re: Perl Docs.. forget the original post, no
<no.unsoliciteds@dead.end.com> said:
(apologies if any of the snipping leads to out-of-context
citation)
no> going to learn something after a while (not)- Well the
no> QURGE function is just like the C QURGE. Great, so do I
no> have to learn C just so I can understand what the
no> function does? ...
no> references are just as lazy,
one word: parsimony (and you can't get much more
parsimonious than that! :-).
<imho>
It's better to say "the definitive answer is ===>here"
rather than to put in your own (possibly slanted, wrong, or
incomplete) interpretation.
</imho>
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Thu, 06 Aug 1998 17:33:25 +0900
From: no.unsoliciteds@dead.end.com
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <35C96A56.B69EE397@dead.end.com>
Alastair wrote:
+Bacon wrote:> Such is the cost of catering to the LCD. :-(
***Greg you learned the wrong language, try python it's not used on the web :)
> Hmmm. Actually it is :\
> Just not as much as perl.
I stand corrected on this, Greg I take back what I said sounds like Python
already has too many user for you, tell you what why not start your own
language - that way you could limit who used it
------------------------------
Date: Thu, 06 Aug 1998 10:41:54 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Premature end of script headers & Exec format error
Message-Id: <35C97A62.266BC149@nortel.co.uk>
Jim Fairbrother wrote:
>
> Can't call method "mailto" in empty package "fairbrothers@smart.net"
> at /home/fairbrothers/www/cgi-bin/verify.pl line 52.
That's rather funny. YOu have to check what that mailto line is doing
>
> exec of /home/fairbrothers/www/cgi-bin/thankyou.gif failed,
> reason: Exec format error (errno = 8)
I usually see this if I forgot to tell the web server what to do with
the script. So include the shebang line, telling where Perl sits, and
make the script something like chmod 755.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 05 Aug 1998 23:25:59 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: rename problem
Message-Id: <m3n29ir5hk.fsf@windlord.Stanford.EDU>
Martin <minich@globalnet.co.uk> writes:
>> ive tried this
>>
>> rename $old, $new;
>>
>> but it does work! is it wrong? anyone help?
> Is it a Unix server?
This is actually a good question, but maybe not for the reasons why you
asked it (as your additional comments didn't make much sense to me). Some
platforms don't support rename(), so that's one possibility. Unix, of
course, does.
> I often find brackets help a lot when something should work but doesn't!
> Try:
> rename($old, $new);
In this case, this is exactly equivalent to calling it without the parens;
if there is any difference in behavior, that's a bug in Perl.
> Remember, rename does not work across system boundaries! (I haven't got
> a clue what that means btw, but it doesn't the manpage says so so it
> must be true).
It means, at least under Unix, that you can't rename a file on one disk
partition to a path on a different disk partition (or to be more general,
a different file system).
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 06 Aug 1998 06:02:29 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Retrieving file from REMOTE_ADDR ... HELP!
Message-Id: <6qbg74$5dp$1@rand.dimensional.com>
In article <6qavtq$585$1@goblin.uunet.ca>
hector@followme.com (Hector Catre) wrote:
>I want to write a Perl Cgi that helps me locate my file on my computer (client
>side), and copies it to the server. The concept isn't difficult. Figuring out
>how to do this is what I need help with.
This is not possible to do using server side CGI, regardless of whether
it is written in perl. Think about it, to do this you must have
information about the filesystem on the client side. You cannot discover
this information without asking the client for it. When you ask the
client, some process _must_ run on the client to make this information
available.
>Hmmmm ... I thought this was the Perl Misc. Newsgroup. This does go under
>miscellaneous doesn't it?
Yes, this qualifies as miscellaneous. But it isn't related to perl in
any way. It isn't possible to do what you are asking with just perl
running on just the server. You may want to write something using
java, vbscript, or javascript depending on your preferences, but
you are going to have to write something that runs on the client,
period.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Thu, 06 Aug 1998 03:39:12 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Retrieving file from REMOTE_ADDR ... HELP!
Message-Id: <35c92358.52109092@news2.cais.com>
hector@followme.com (Hector Catre) Said this:
>In article <Pine.GSO.4.02.9808051359250.14291-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> wrote:
>>On Wed, 5 Aug 1998, Hector Catre wrote:
>>
>>> I have a website
>>
>>That's nice. :-)
>>
>>> I have a jpg that I want to upload to the server
>>
>>So far, so good.
>>
>>> I want the cgi to open up a directory listing of my (client side) computer,
>>
>>Maybe you want to write a CGI program to do that.
>
>Gee, what do you think I'm doing here? I don't know how to do this! I still
>need help.
>
>>> then after I choose what that file is, the cgi-uploads it to the
>>> server
>>
>>So, you want your program to let you choose a filename, then your remote
>>user will upload it? Or will _you_ be the remote user? This isn't clear.
>
>I want to write a Perl Cgi that helps me locate my file on my computer (client
>side), and copies it to the server. The concept isn't difficult. Figuring out
>how to do this is what I need help with.
>
>>Of course, there's nothing Perl-specific about this. If your problem is
>>with the CGI interface, perhaps the docs, FAQs, and newsgroups about the
>>CGI interface and related topics would help you. Good luck!
>
>Hmmmm ... I thought this was the Perl Misc. Newsgroup. This does go under
>miscellaneous doesn't it? I want to write it in perl specifically. But, I
>don't know how to use a server side Perl CGI to open up my remote side
>directory structure, nevertheless, figure out how to copy it over ... again
>.. in perl. If the file were local to the server then this wouldn't be a
>problem. But it isn't, and that's where I have no idea of how to do this.
>
>Again ... HELP!!!!!!!!!!!
Okay. First of all, you can't do anything from the server to "open"
the directory tree of your client machine. That's just not possible
(well, microsoft seems to like this idea).
What you want is not possible as you describe it.
What you want, as I've INTERPRETED it, however, is to have a form
field with a "BROWSE" button next to it, like you see at the banner ad
exchange sites, and other sites like that, right? The browsing
feature is purely and completely local to that client, the server side
has no idea this is going on.
This is the basic construct of the <input> tag to enable the uploading
of files:
<INPUT TYPE="File" NAME="foo">
You'll need to have your perl script enabled to accept the file, but
CGI.pm can handle it for you. Look at the instructions for CGI.pm to
find out more.
------------------------------
Date: Thu, 6 Aug 1998 11:37:26 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Retrieving file from REMOTE_ADDR ... HELP!
Message-Id: <Pine.HPP.3.95a.980806112953.18593A-100000@hpplus01.cern.ch>
On Thu, 6 Aug 1998, Hector Catre wrote:
> >Maybe you want to write a CGI program to do that.
>
> Gee, what do you think I'm doing here?
I think that's what everyone else would like to know. The CGI group is
thattaway. This is the group about miscellaneous Perl _language_
issues.
> I want to write a Perl Cgi that helps me locate my file on my computer (client
> side), and copies it to the server. The concept isn't difficult.
No, the concept isn't difficult, there simply isn't a WWW solution in
the terms that you are demanding. A program that's running on the server
doesn't, in general, have access to the filesystem of the client. But
you've already been told this, but were apparently too obsessed with
establishing your position on c.l.p.m to worry over much about solving
your actual problem.
Haven't you already been told about INPUT TYPE=FILE?
> >Of course, there's nothing Perl-specific about this. If your problem is
> >with the CGI interface, perhaps the docs, FAQs, and newsgroups about the
> >CGI interface and related topics would help you. Good luck!
Which you apparently were too stubborn to pay attention to.
------------------------------
Date: 6 Aug 1998 08:57:56 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: setting a password on a linux system via cgi.....
Message-Id: <slrn6sisfe.ak.randy@theory.uwinnipeg.ca>
On Wed, 5 Aug 1998 19:36:38 -0400,
> Brad Jones <bandahr@the-neighborhood.com> wrote:
>Hello all, anyone have a suggestion as to how to allow a new user to create
>an account and change a password via a cgi script? I think I have the
>creating the user part taken care of but don't know how I can set the
>password for the account using passwd program......Any help is greatly
>appreciated......
>
>Brad
>
>
Hi,
You might want to check out the latest issue of the Perl Journal
(http://www.tpj.com/) - Lincoln Stein has an article about changing
passwords via a cgi script. The source for the example code he uses
is also available at this URL.
Best regards,
Randy Kobes
--
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Thu, 06 Aug 1998 10:21:39 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Single word ouptu from aa array
Message-Id: <35C975A3.5C87F888@nortel.co.uk>
Tad McClellan wrote:
>
> : >Im new to Perl. I'M trying to place a file, a txt file, into an array..then
> : >print out the first character of the first line..and then the second
> : >character....etc..
You know that that's not enough information for a mathematical series?
1) print out the first character of the first line, then the second
character of the first line, etc.
open INFILE, "/u/quednauf/temp/testfile.txt" or die "Outta here:$!";
while (read INFILE, $thing, 1) { print "$thing\n" }
close (INFILE);
2) print out the first character of first line, then the second
character of the second line, etc.
$i=0;
open INFILE, "/u/quednauf/temp/testfile.txt" or die "Outta here:$!";
while (<INFILE>) {
$i = ($i >= length($_) - 1) ? 0 : $i;
print $i;
print substr $_, $i++, 1; print "\n";
}
close (INFILE);
This scripts starts at zero again if it encounters a sentence shorter
than the current count (also ignoring \n as a character). Useless, but
possible.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 05 Aug 1998 23:18:32 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: socket problem
Message-Id: <m3pveer5tz.fsf@windlord.Stanford.EDU>
Justin Perkins <jperkins@wtmail.wtamu.edu> writes:
> I think I set up everything correctly but the error message I keep
> getting is: "can't assign requested address" when it tries to connect.
> Anybody know what might be going wrong? I'm using Novell's perl5.nlm.
> $port = 2345 unless $port;
> $AF_INET=2;
> $SOCK_STREAM=1;
> $SOCK_ADDR= "S n a4 x8";
You're hard-coding constants, and quite possibly attempting to run this on
a system where those hard-coded constants are the wrong numbers. One
should never do this if it is avoidable, and in this case it is. Rather
than what you're doing, see perldoc Socket and use the Socket module; it
makes this much easier and avoids the magic pack.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 06 Aug 1998 09:05:46 +0000
From: Adam Ipnarski <adam@fastfare.co.uk>
To: Niklas Matthies <matthies@fsinfo.cs.uni-sb.de>
Subject: Re: split & empty patterns
Message-Id: <35C971EA.859A48BA@fastfare.co.uk>
Niklas Matthies wrote:
>
> Hi,
>
> From the perlop man page:
>
> If the PATTERN evaluates to a null string, the last
> successfully executed regular expression is used
> instead.
>
> Let's try this:
>
> "" =~ // && print "1\n";
> TEST =~ /S/ && print "2\n";
> "" =~ // && print "3\n";
-[snip]-
> TEST =~ /S/ && print "1\n";
> @foo = split //, TEST;
> print join (_, @foo), "\n";
>
> This ouptuts:
>
> 1
> T_E_S_T
>
-[snip]-
> Is there some logic behind this?
>
> -- Niklas
Yes there is. In Perl, split seems to always evaluate the pattern
passed to it, even if it is a null regexp pattern. I would assume this
is to allow splits exactly like the one you've described, as the man
page suggests that: 'Anything matching PATTERN is taken to be a
delimiter separating the fields.', Anything, including '' I suppose.
Hope this helps.
--adam
Adam Ipnarski, Developer
adam@fastfare.co.uk | www.travelselect.com
------------------------------
Date: Thu, 06 Aug 1998 09:51:51 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: X-file (?=...), case postponed.
Message-Id: <35C96EA7.112725B3@nortel.co.uk>
Abigail wrote:
>
> F.Quednau (quednauf@nortel.co.uk) wrote lots of stuff...
> You lost it in the first step. /(?=(.*))/ does *NOT* mean zero or
> more characters.
..and..
++ What stops the whole thing ever matching the whole
++ sentence for doing a split?
That's explained very clearly in the documentation related to split.
I'll put this to the X-files. Unexplained mysteries. Don't worry, one
day I'll have enough knowledge to read the documentation in a way you
do, because I can't see that! And .* doesn't match zero or more
characters? Aaanyway, I might have to get 'mastering regular
expressions' after all.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3373
**************************************