[8715] in Perl-Users-Digest
Perl-Users Digest, Issue: 2332 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 15 22:07:32 1998
Date: Wed, 15 Apr 98 19:00:31 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 15 Apr 1998 Volume: 8 Number: 2332
Today's topics:
Array slices using variables for range <fridman@cpsc.ucalgary.ca>
Re: Array slices using variables for range (Craig Berry)
Re: Array slices using variables for range <danboo@negia.net>
Re: Array slices using variables for range <danboo@negia.net>
Re: avoid double-click on submit button (Abigail)
Re: Can I do this: <A HREF=laughs.pl?@laughs> (Abigail)
Re: considerations for global variables? (Tom Mornini)
Re: Converting Perl (Jonathan Stowe)
Re: HELP with a compare sequence (Abigail)
Re: How to execute more than one command via System (Jonathan Stowe)
Re: how to parse a "this", "that", "and the ", "other" (Martien Verbruggen)
Re: IMAGEPUSH problems with MSIE (Jonathan Stowe)
Re: info on cookies <ljz@asfast.com>
My macperl scripts don't shut down after 5 minutes as t <eslcafe@callisto.si.usherb.ca>
Re: Need to find web-based e-mail client in Perl! (Martien Verbruggen)
Re: Need to find web-based e-mail client in Perl! (Neil Kandalgaonkar)
Re: Numeric validation <sneaker@earthling.net>
On-line Community Needs Help! <webmaster@office????biz.com>
passing persistant data - was Re: considerations for gl <dtbaker_@flash.net>
Re: Password encryption and /etc/shadow file. <sneaker@earthling.net>
Re: Perl 5.004_64 Slower??? (Martien Verbruggen)
Perl, warning message ?? <root@gitnet.com>
Re: Recursive Calls in Perl ? (Jonathan Stowe)
Re: RMS should be invited to O'Reilly's "Free Software <seniorr@teleport.com>
Re: RMS should be invited to O'Reilly's "Free Software (Thomas Bushnell, n/BSG)
Re: Sorting problem (Tad McClellan)
Re: understanding Perl<->.html forms? <dtbaker_@flash.net>
Re: understanding Perl<->.html forms? (brian d foy)
Re: understanding Perl<->.html forms? <dtbaker_@flash.net>
unpack and physical network address (Dale Wityshyn)
Re: unpack and physical network address (Jason Gloudon)
Re: Which Win32 Perl (Jonathan Stowe)
Re: WIN32::Process::Create doesn't work in Win 95. Why? (Troy Denkinger)
Re: Win32:GetFreeDiskSpaceEx <thn@ehs.dk>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 15 Apr 1998 16:59:23 -0600
From: Robert Fridman <fridman@cpsc.ucalgary.ca>
Subject: Array slices using variables for range
Message-Id: <35353BCB.1D68@cpsc.ucalgary.ca>
Perl (version 5.004_04 built for sun4-solaris) complains that line 9 of
the following program uses an uninitialized value. I suspect that this
is caused by the fact the during the compilation stage, the value of
$length is not known.
Is there a way to use the -w flag and not have the warning message show
up everytime I run it?
#!/usr/local/bin/perl -w
@a = qw(a b c d e f);
$length = @a;
$three = 3;
print $length,"\n";
print join " ", @a, "\n";
print join " ", @a[0..3], "\n";
print join " ", @a[0..$three], "\n";
print join " ", @a[0..$length], "\n"; <---- line 9
output:
6
a b c d e f
a b c d
a b c d
Use of uninitialized value at ./t.pl line 9.
Use of uninitialized value at ./t.pl line 9.
a b c d e f
Thanks in advance.
Robert.
----------------------------------------------------------------------
Robert Fridman fridman@cpsc.ucalgary.ca
WurcNet Inc.
University of Calgary
Calgary, Alberta
Canada fax (403) 284-4707
------------------------------
Date: 15 Apr 1998 23:29:41 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Array slices using variables for range
Message-Id: <6h3ft5$su9$2@marina.cinenet.net>
Robert Fridman (fridman@cpsc.ucalgary.ca) wrote:
: Perl (version 5.004_04 built for sun4-solaris) complains that line 9 of
: the following program uses an uninitialized value. I suspect that this
: is caused by the fact the during the compilation stage, the value of
: $length is not known.
Not so, see below...interesting guess, though.
: Is there a way to use the -w flag and not have the warning message show
: up everytime I run it?
By fixing your code. :)
: #!/usr/local/bin/perl -w
: @a = qw(a b c d e f);
The length of which is 6, as your printout below shows. Since Perl
arrays are (barring use of deprecated features) zero-based, this means
that it contains elements at indices 0..5.
: $length = @a;
: $three = 3;
: print $length,"\n";
: print join " ", @a, "\n";
: print join " ", @a[0..3], "\n";
: print join " ", @a[0..$three], "\n";
: print join " ", @a[0..$length], "\n"; <---- line 9
$length is 6, so this reduces to [0..6] -- but as I noted above, the
actual initialized indices run only [0..5]. So, helpful Perl
automagically creates an uninitialized seventh element at index 6, which
when yields an empty string in the join (which is why you don't see it)
and also quite appropriately caused Perl to complain about the use of an
uninitialized value.
Changing the upper bound to ($length - 1) will resolve the problem.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 15 Apr 1998 19:46:57 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Array slices using variables for range
Message-Id: <353546F1.FBD51071@negia.net>
Robert Fridman wrote:
>
> Perl (version 5.004_04 built for sun4-solaris) complains that line 9 of
> the following program uses an uninitialized value. I suspect that this
> is caused by the fact the during the compilation stage, the value of
> $length is not known.
well, this is a runtime warning and $length is known, so i doubt that's
it. the problem is that $length is one number too high. try printing it
and then look into the indexes of the elements you are trying to access.
> Is there a way to use the -w flag and not have the warning message show
> up everytime I run it?
>
> #!/usr/local/bin/perl -w
> @a = qw(a b c d e f);
> $length = @a;
> $three = 3;
> print $length,"\n";
> print join " ", @a, "\n";
> print join " ", @a[0..3], "\n";
> print join " ", @a[0..$three], "\n";
> print join " ", @a[0..$length], "\n"; <---- line 9
well my first suggestion would be to set length to $#a (i.e., the
last index of @a). using @a in a scalar assignment gets the number
of elements in @a. so in your slice you have 0,1,2,3,4,5, or one
element too many.
if that won't work for some reason, you could use map or grep depending
upon your needs. try replacing line 9 with variations on these.
convert undefined values to empty strings:
print join " ", map defined $_ ? $_ : '', @a[0..$length], "\n";
only return defined elements:
print join " ", grep defined, @a[0..$length], "\n";
and beyond that you could always shutdown warnings for that operation:
{
local $^W;
print join " ", @a[0..$length], "\n";
}
though i wouldn't use this. just think of what you've learned already
by having warnings active. keep up the good habit.
cheers,
--
dan boorstein
------------------------------
Date: Wed, 15 Apr 1998 19:51:15 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Array slices using variables for range
Message-Id: <353547F3.76B8923E@negia.net>
Dan Boorstein wrote:
> of elements in @a. so in your slice you have 0,1,2,3,4,5, or one
> element too many. ^
oops. insert a 6. actually it was meant like a logical 'or'. the
first statement is false so it falls through to the second which is
correct. yeah, that's what i meant. ;)
--
dan boorstein
------------------------------
Date: 16 Apr 1998 00:11:58 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: avoid double-click on submit button
Message-Id: <6h3ice$ie1$1@client2.news.psi.net>
Daryl Nguyen (daryl.nguyen@utoronto.ca) wrote on MDCLXXXVIII September
MCMXCIII in <URL: news:3534D9A6.321A50D7@utoronto.ca>:
++ The problem is if one double clicks on the submit button, the perl
++ script will run twice, if n-click on the submit button, then the script
++ will run n-times.
++
++ I just want to have a script run just ONCE regardless of how many
++ clicks.
unlink $0;
Please ask your question in the appropriate newsgroup (CGI? we're not
even sure this is for a CGI script). You question hasn't much to do
with Perl.
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9;
${qq$\x5F$} = q 97265646f9; s g..gqq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: 16 Apr 1998 00:22:15 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can I do this: <A HREF=laughs.pl?@laughs>
Message-Id: <6h3ivn$ie1$2@client2.news.psi.net>
Anu N. Melkote (amelkote@ford.com) wrote on MDCLXXXVIII September
MCMXCIII in <URL: news:353505B7.3551@ford.com>:
++ Greeting Everybody !
++
++ I am trying to pass an array from one perl script and retreving it with
++ QUERY_STRING in another perl script. I am doing something like this:
++
++ In the initial perl pgm:
++ @laughs = qw (hoho, hehe, haha);
^ ^
| |
What are those comma's doing there?
++ <A HREF = 'laughs.pl?@laughs'> Print Laughs </A>;
++
++ In laughs.pl I am trying to read the array via QUERY_STRING:
++ @laughlist = $ENV{'QUERY_STRING'};
That is probably not what you want. $ENV{QUERY_STRING} starts
with a $, so it's a *scalar*. One thing, nothing more. Yet on
the left handside, you have a @. Always think 14 times before
writing a thing like that.
++ Now, if I print @laughlist, I see only the first element in the array
++ "hoho"
++ However, in the URL I can see all the elements like this:
++ http://......./laughs.pl? hoho hehe haha
I don't believe you.
I would expect the URL to be 'laughs.pl?hoho, hehe, haha', which
is an illegal URL as it contains spaces.
++ How can I grab all elements of the array I passed? Thanks in advance !
You can't pass arrays. Period. You can pass *strings*, and hence you
need to collapse your arrays into strings, and later split the
string into an array again.
You might want to read about "join" and "split", and your qw needs some
brushing up as well. Furthermore, if you use CGI, it can take care of
(un)escaping forbidden characters for you.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: Thu, 16 Apr 1998 01:52:41 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: considerations for global variables?
Message-Id: <tmorniniErHH7t.Hp0@netcom.com>
Dan Baker (dtbaker_@flash.net) wrote:
: I would like to learn more about the considerations and options for how
: to use "global" variables in perl scripts which are not in a single
: program.... i.e. a .html page may execute one script to create or modify
: some values which need to be used by a different script at a later time.
In the most recent TPJ, http://www.tpj.com, there is an article about
mod_perl where he shows how to use shared memory for holding state info.
-- Tom Mornini
-- InfoMania
------------------------------
Date: Tue, 14 Apr 1998 12:43:43 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Converting Perl
Message-Id: <35331e5c.6198231@news.btinternet.com>
On 14 Apr 1998 04:38:57 GMT, David Fetter <dfetter@shell4.ba.best.com>
wrote:
<snip>
>Should someone install it on your system, delete it immediately.
>
Actually I think you are being a little harsh. I understand that BG
wanted to call to call it "My First Server OS" as a sop to all those
younger users out there who had never seen a computer without a GUI
but was restrained by the threat of legal action by a Toy
manufacturer. And if my Tech support colleague says "Its a bit like
the problems you had with Netware 3 " He'll feel the lash of UTP I
tell you...
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: 16 Apr 1998 00:09:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: HELP with a compare sequence
Message-Id: <6h3i74$ibb$1@client2.news.psi.net>
skruzich@stc.net (skruzich@stc.net) wrote on MDCLXXXVIII September
MCMXCIII in <URL: news:6h2lpt$uum$1@nnrp1.dejanews.com>:
++ Problems encounted.
++
++ 1. The system( statement below, loops, without getting to the subroutines).
++
++ exec("date +'%a'` > today");
Maybe you want to read the manual about the side effects of exec.
And while you're at the manual, read about localtime.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Tue, 14 Apr 1998 12:43:47 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: How to execute more than one command via System
Message-Id: <35334d5f.18232848@news.btinternet.com>
On Wed, 15 Apr 1998 11:34:24 GMT, vasekk@cdi.cz (Vaclav Kulakovsky)
wrote:
>try this
>
>system("copy file1 file2 > file.tmp");
>system("del file.tmp");
>
You dont need the second system() really:
unlink("file.tmp");
Infact possibly:
system("copy file1 file2 >nul:");
should do. NUL being a pseudo-device bitbucket like /dev/null on unix
(I'm assuming its still there on NT having been with MS since they
tried to unix DOS 2 up a bit back in the faery time before windows)
You might alternatively consider doing away with the system()
altogether by using File::Copy or one of the other alternatives
advocated here a little while ago (better check DejaNews for the full
SP on that)
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: 15 Apr 1998 23:26:07 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how to parse a "this", "that", "and the ", "other" file
Message-Id: <6h3fmf$p3t$3@comdyn.comdyn.com.au>
In article <6h1e2l$ddc$1@gaia.ns.utk.edu>,
"Bob Gwynne" <gwynne@utkux.utk.edu> writes:
> This must be a class assignment. It's the second VERY similar question
> posted today.
Which is another thing I like about Perl and the Perl community. Most
of these questions can be answered with something like "Use
this-or-that module", which most likely will not be regarded as the
correct answer to a homework assignment, but is the correct answer for
real life applications.
Stops students from having someone else do their homework for them :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Tue, 14 Apr 1998 12:43:41 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: IMAGEPUSH problems with MSIE
Message-Id: <3533153b.3952842@news.btinternet.com>
On Sun, 12 Apr 1998 23:35:31 -0600, rsudduth@comweb.net wrote:
>
<snip>
>
>Here is the Headers for Netscape that we use...
>
> print "\n--ThisRandomString\n";
> print "Content-Type: image/jpeg\n";
<snip>
>
>Now this is what does now work on IE ;-)
>
> print "Content-Type: image/jpeg\n";
> print "Content-Length: $len\n";
<snip>
Of course one would usually advise the usual more appropriate
resources for advice on this matter - but I am deeply intrigued by the
purpose of the first line in the first example. It certainly is not
part of the HTTP spec as far as I know ;-} Why cant you just leave it
out altogether?
You might consider examining the HTTP spec as referenced via the URL
below.
>
>rsudduth-NO SPAM PLEASE-@comweb.net
>
Them spammers already got your address from the header chum. This I
also find an intriguing behaviour.
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: 15 Apr 1998 20:56:11 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: info on cookies
Message-Id: <ltyax6k2j8.fsf@asfast.com>
Tom Phoenix <rootbeer@teleport.com> writes:
> On 15 Apr 1998, Lloyd Zusman wrote:
>
> > Either Gilles Chong is saying that no env. variable is being set at
> > all (your interpretation, which indeed might indicate some kind of
> > server issue),
>
> Which is to say, not a Perl-specific problem...
>
> > or else Gilles Chong is unaware of the name of this variable and is
> > trying to learn this in order to access cookies in Perl-based cgi
> > scripts (my interpretation).
>
> Which is to say, not a Perl-specific problem...
But there is an elegant, Perl-based solution to it.
> The name of the environment variable is the same no matter what language
> is being used to do the work. If I were to ask in a newsgroup about
> Toyotas for someone to tell me how to drive my Toyota to the Golden Gate
> Bridge, they would laugh at me - there's nothing Toyota-specific about
> that question. And even if some helpful person there gave me the answer
> there, that person should point out that such questions are better asked
> and answered in a newsgroup about San Francisco. That way, I'm able to go
> to that newsgroup and learn more about SF than just that one answer, as
> well.
There are a number of helpful people here in comp.lang.perl.misc who
are happy to urge the poster to go to a different newsgroup. I don't
need to expend that effort myself.
As for my preferred way to help the poster ...
First of all, I assume you read my initial response, in which I told
the original poster that the name of the env. variable is not
important if one uses the Perl CGI module to manage cookies. This is
a nice, Perl-oriented solution the problem that I was (and still am)
convinced that the original poster is having. It shows that with the
proper use of some of Perl's excellent modules, knowledge about such
things as env. variables and other detailed inner workings of certain
commonly-performed tasks (such as accessing cookies in a cgi program)
is not necessary, and the project at hand can be performed easily and
elegantly.
Secondly, in this same initial response, I referred the poster not to
a CGI newsgroup, but rather, right to the documentation for the CGI.pm
module, and I even named the exact section in this documentation which
covered the question I believe that the poster is asking. I was (and
still am) convinced that by reading the excellent documentation about
cookies in the CGI package's man pages, the poster would more quickly
and efficiently get the sought-for information than if he or she had
to go through another posting scenario at some other newsgroup. These
man pages give (among other things) a very usable and to-the-point
description of cookies and how to make use of them in a
CGI-module-based Perl script without having to worry about such things
as environment variable settings.
Thirdly, and still in my same initial response, I gave a short code
snippet showing, in a summary fashion, how to use the Perl CGI module
to solve the problem that I believe the poster is having.
Seeing as how I presented information about an elegant Perl-based
solution to the problem that I'm convinced that the poster is having,
and given that I did so in a Perl-positive manner that encourages Perl
use, I see no reason to chase (or even gently nudge) the original
poster off of the Perl newsgroup. If you or other people wish to do
that, then feel free, but I won't be part of that effort.
> If you choose to answer a CGI-specific question in a non-CGI newsgroup,
> you should be commended for your helpfulness.
Thank you very much.
> [ ... ] It would be even more helpful of you to suggest to the
> poster that similar questions - and their answers - appear in
> another newsgroup and its FAQ list. An on-topic newsgroup is always
> a better place to find an answer.
I clearly suggested the CGI package's man pages in my initial
response. In my second response, I also referred the poster to the
CGI::Cookie man pages, as well as to a URL (mentioned in the
CGI:Cookie man pages) for the RFC about cookies. These are all very
good places to go to find detailed information concerning the poster's
concern as I see it. You're absolutely right that I didn't suggest
the CGI newsgroup(s), but I don't see why I should do that, especially
given the high likelyhood that several other regular contributors to
comp.lang.perl.misc would eagerly jump at the chance to find some
clever way to do so.
So in summary, I did refer the person to documentation, and I did
offer the person help which showed how Perl could be an excellent tool
for solving the perceived problem at hand. However, I didn't urge the
poster to go to another newsgroup. That means that I followed some,
but not all of the "guidelines" that many of the regulars in
comp.lang.perl.misc would like us all to adhere to. So be it.
If comp.lang.perl.moderated ever comes into existence (which, by the
way, would be an answer to my heartfelt prayers), then someone like me
who follows many, but not 100 percent of that newsgroup's guidelines
could be prevented from posting by the moderator(s). Until then, you
will probably just have to deal with the fact that some of us would
prefer to offer Perl-based and Perl-positive solutions in this current
newsgroup, and leave the distasteful task of sending people to other
newsgroups to those eager others who get more enjoyment out of doing
so than we do.
> Cheers!
God bless you.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: Thu, 16 Apr 1998 01:35:46 GMT
From: John Taylor-Johnston <eslcafe@callisto.si.usherb.ca>
Subject: My macperl scripts don't shut down after 5 minutes as they are supposed to!
Message-Id: <3301166F.6847@callisto.si.usherb.ca>
OK - we know we are doing something wrong! My macperl apps don't shut
down automatically after 5 minutes! And my server admin is in a tizzy.
Most scripts are still running the next morning - sometimes it is the
same ones over and over. (They are saved as cgi-scripts!?) What I don't
understand is why can't I shut them down even when I double click on
them, receive the menu to shut them down, and click on shut down from my
station, in my directory! The sys admin has to do it himself. ... The
next morning he arrives, looks in teh finder menu and sees 5 or 10
macperl apps still running! There must be a way to limit their time.
(Don't they shut down automatically? Can I programme perl to shut tehm
down immedaitely after use? This is what pisses off my sys admin!)
MORE INTERESTING
>From time to time, I get response from netscape that says that "The
document contains no data". It seems to be these that cause the trouble.
I rename them, (try to) erase them or otherwise and resave the app with
my back up file - this seems to overcome the problem - sometimes. (I
have run the check syntax and ran the perl app before I try testing it
from the net.)
I'm wondering if I should save my apps as perl droplets, but they don't
seem to work.
For the moment my sys admin :-( has banished macperl from the main
server to another IP where I am to test and solve the problem with
macperl before he lets Macperl back in!
(I'm using Webstar 1.0 on a power mac. System 7, soon to be udated to
sys 8 and web star 3)
Thanks!
------------------------------
Date: 15 Apr 1998 23:13:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Need to find web-based e-mail client in Perl!
Message-Id: <6h3eug$p3t$1@comdyn.comdyn.com.au>
In article <6h1uit$2p0$1@nnrp1.dejanews.com>,
Tim@netshift.com writes:
> In article <lu7m4t46ln.fsf@asfast.com>,
> Lloyd Zusman <ljz@asfast.com> wrote:
>>
>> abigail@fnx.com (Abigail) writes:
>>
>> > Elmira Alimova (ea187@columbia.edu) wrote on MDCLXXXVI September MCMXCIII
>> > in <URL: news:353227C4.9329DD6B@columbia.edu>:
>> > ++ Hello! My school is installing web kiosks for the students. Idea is to
>> > ++ enable them to get mail also.
>
> The simplest way to allow mail on kiosks is to use a purpose built front end
> such as NetShift - free download available from http://www.netshift.com -
> This has all the built in security you need for email reading including
> privacy provisions such as not using the hard disk for storage of emails and
> instant cache clearing. Any more details please contact me.
You don't think this is overkill for the original question?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: 16 Apr 1998 01:52:14 GMT
From: neil@domingo.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Need to find web-based e-mail client in Perl!
Message-Id: <6h3o8e$egq$1@newsflash.concordia.ca>
In article <6gumiq$9nm$1@gaia.ns.utk.edu>,
Bob Gwynne <gwynne@utkux.utk.edu> wrote:
>You could probably personalize
>the script for each student by giving each script a different name, e.g.,
>johnsmail.pl, sarasmail.pl, etc., and loading up your HD with as many
>scripts as there are students.
What a unique solution. At my university there were 30,000 students. If
each script is tightly written, providing email shouldn't require more
than 30,000 files and 150 MB of software.
Seriously though, maybe this MailMan thing solves all the problems (and
there are many). But, if all you need is a system that works on a few
kiosks, I'm not sure web-based email is the right thing to do. There are
other options.
1) clients that can be scripted into quick reconfig for each user,
reading mailboxes and preferences over the network.
2) use email clients that run on the remote host and have X Windows
interfaces (much as I hate X windows, it has its uses.)
3) how about putting a telnet program on the kiosk and letting
them use Pine or other email programs, from their regular unix accts?
> In lieu of that, perhaps Abigail would be kind enough to dash off what
>you want. It would be her good deed for the day.
You have it easier than she does. To improve the Perl community, all you
have to do is shut up whenever you feel the urge to post comments like
this.
--
Neil Kandalgaonkar
njk@odyssee.net
------------------------------
Date: Thu, 16 Apr 1998 01:14:13 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Numeric validation
Message-Id: <353559D2.9A255970@earthling.net>
Tom Christiansen wrote:
> --tom, who sees no reason to write any more documentation for ingrates.
I have to disagree with you Tom! I feel strongly
that you should continue to write the docs for Perl
as long as you can stand it!
Reason? I feel, after only reading since 5.001 or so,
that the documentation is getting better. So, therefore
you should keep up the good work :-)
You and the help of others have made it better than
regular Unix man pages - which mostly bite anyways.
I especially like 'perldoc' and send thaks to all who
helped write it!
--
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|
------------------------------
Date: 16 Apr 1998 01:38:03 GMT
From: "John Paulson" <webmaster@office????biz.com>
Subject: On-line Community Needs Help!
Message-Id: <6h3ndr$f8m@bgtnsc02.worldnet.att.net>
Hello Programmers,
I am currently designing an On-line Business Community called Office Biz
and I am looking for other Programmers that would exchange work for Web
space, percentage of Ad Revenue, Recognition, POP E-mail account and other
future benefits. I am looking for experienced and innovative people that
work well in a team environment over the Internet. Community growth would
mean paid work.
The Web site already has 1,800+ hits with very little marketing. This is a
good opportunity for
aspiring Programmers who want to show their skills and get
recognition.Please go to
http://www.officebiz.com/programmers.htm or E-mail me at
webmaster@office????biz.com
Remove (????) to E-mail.
Thanks,
John Paulson
Owner/Operator
Accent
Technology Services
& Web Development
Houston, Texas
------------------------------
Date: Wed, 15 Apr 1998 17:25:18 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: passing persistant data - was Re: considerations for global variables?
Message-Id: <353541DE.41FA@flash.net>
John Porter wrote:
> Well now, if WWW is the context of your application... have you
> considered using cookies? Might be a nice elegant solution to
> the problem of passing state from one cgi program to the next.
---------
sounds like an interesting possability... please expand on the general
considerations/limitations! I don't know ANYTHING about what is possible
with cookies.
The application I'm working on is not truely a WWW application because
it is not going to be used over the web and through servers. I really
just intend to use html/perl as interface tools for a simple text-based
application that is single user local on a single machine. html can
handle all the interface needs I have, and perl can handle all the data
munging, but I'm struggling a little with methods to pass data to
emulate procedural data passing.
At this point I think I can fake it with temp text files holding
variable names and values, but I'm interested in learning about
alternate methods! There won't be huge tables of data, so I probably
don't need to use DBM functions, right?
Dan
------------------------------
Date: Thu, 16 Apr 1998 01:23:23 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Password encryption and /etc/shadow file.
Message-Id: <35355BF9.54CBD97@earthling.net>
Marcelo J. Iturbe wrote:
> The problem here is that the new password that is placed in the
> /etc/shadow file is not compatible with the system. I try to log in
> using the new password and fail.
> I have tried various srand() methods, I have even tried omiting the
> srand method with no success.
> I have tried using 1,2,3,4, and 5 salt characters and none worked.
>
> Thanks for your help
> Marcelo Iturbe
What you're trying to do somewhat system
dependent; over at www.perl.com, under Security -
see my WebPass package for ideas, then see
Expect.pm, and things like Shadow - these will
get you going in the right direction.
HTH,
Sneex :-)
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|
------------------------------
Date: 15 Apr 1998 23:21:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl 5.004_64 Slower???
Message-Id: <6h3fdh$p3t$2@comdyn.comdyn.com.au>
In article <1d7j17x.1jt3gon1tbq2niN@ppp35.vo.lu>,
domo@tcp.ip.lu (Dominic Dunlop) writes:
> (Not that I believe threads have anything to do with this er... thread,
> as even development versions of perl don't build with thread support
> unless specifically directed to. The same will be true of 5.005 when it
> appears.)
And quoting from Bill 'Sneex' Jones' post:
> Summary of my perl5 (5.0 patchlevel 4 subversion 64) configuration:
> Platform:
> osname=linux, osvers=2.0.31, archname=i586-linux-thread
> uname='linux sneex 2.0.31 #1 sun nov 9 21:45:23 est 1997 i586 unknown '
> hint=recommended, useposix=true, d_sigaction=define
> usethreads=define useperlio=undef d_sfio=undef
[SNIP]
Doesn't the "usethreads=define" here mean that the binary was compiled
for thread support? I haven't actually compiled this myself yet, but
that's how I would read it.
If the binary was indeed compiled with thread support, which looks
like it, and without knowing anything about the program, which we
don't, it seems fairly reasonable to assume that this perl binary
seems slow, because of the thread support.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: Thu, 16 Apr 1998 01:13:35 +0000
From: webmaster <root@gitnet.com>
Subject: Perl, warning message ??
Message-Id: <35355B3E.F661A3EF@gitnet.com>
Hi,
I just installed perl 5.004 on my RH5.0 Linux box, but when I try to run
some small perl script, it always shows this following message :
perl: warning: Setting locale failed
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "EN"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")
I'm newbie for linux stuff, so if somebody can help me what's wrong with
it ??
Thanks in advance.
Guruh.
------------------------------
Date: Tue, 14 Apr 1998 12:43:45 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Recursive Calls in Perl ?
Message-Id: <35334a9c.17525688@news.btinternet.com>
On 14 Apr 1998 21:04:12 GMT, Zenin <zenin@archive.rhps.org> wrote:
>
> #!/usr/local/bin/perl
&bomb;
> sub bomb {
> while (1) {
> fork() && bomb();
> }
> }
>
And then you go and hide, the phones ringing, you hear a colleague say
"are you sure the error was 'Cannot fork, out of processes...'"
You sure youre not from the "Dark Side" ;-}
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: Wed, 15 Apr 1998 22:59:19 GMT
From: Russell Senior <seniorr@teleport.com>
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <86k98qlmii.fsf@coulee.tdb.com>
>>>>> "Tim" == Tim Smith <tzs@halcyon.com> writes:
> (2) If by having something free of mine in the proprietary code,
> the proprietary product is improved, I have helped the users of
> that proprietary product.
Barry> Not really.
Tim> Huh? If something I do makes, say, Microsoft Word a better
Tim> program so that its users find it more useful, it sure seems to
Tim> me that I've helped those users. Please explain how I have not.
Because you may have encouraged them to continue using a program that
is ultimately bad for them. To speak metaphorically, you have lit
their cigarette for them.
--
Russell Senior
seniorr@teleport.com
------------------------------
Date: 15 Apr 1998 21:27:33 -0400
From: tb@mit.edu (Thomas Bushnell, n/BSG)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <u1haf9mo8sa.fsf@itti.mit.edu>
In article <edzphyf52w.fsf@zizkov.ucsd.edu> Andy Tai <atai@zizkov.ucsd.edu> writes:
Mr. Tim O'Reilly said that RMS was not invited. I consider this is
unfair to GNU.
Did he say why? Rather than all of us guessing, perhaps we could ask
why?
------------------------------
Date: Wed, 15 Apr 1998 18:01:57 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Sorting problem
Message-Id: <59e3h6.vp6.ln@localhost>
Andrew F. Lee (andrewf@cp.pathfinder.com) wrote:
: sub sortdata {
: @f = ();
: for (@biglist) { push @f, (split ':')[-1] }
: @new = @biglist[ sort { $f[$a] cmp $f[$b] } 0 .. $#biglist ];
: }
: Now it works for ascii ... remember eq vs. =, gt vs. >, <=> vs. cmp
^
^
^
That is yet a different operator (assignment).
You meant == there?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 15 Apr 1998 17:47:45 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: understanding Perl<->.html forms?
Message-Id: <35354721.BC1@flash.net>
John Porter wrote:
>
> Dan Baker wrote:
> >
> > John Porter wrote:
> > > consider using either CGI::MiniSvr or HTTP::Daemon.
> >
> > please expand on this.... why would I need this?
> > In the html form, couldn't I specify the form to POST data directly to
> > my local program.pl? i.e. for this little application, the form, the
> > data, and the perl programs all reside locally (for now anyway).
>
> Think about it. How do a CGI program and a web browser communicate?
> A web client speaks http, but a cgi program speaks cgi.
> Who translates? Yeah, you got it: a web (http) server.
> HTTP::Daemon is a way of making your perl program speak http directly,
> by (in effect) embedding a cgi/http translator in the program.
> > couldn't I specify the form to POST data directly to my local program.pl?
>
> No, that's not the way it works. (Wouldn't that be nice.)
>
> > for this little application, the form, the
> > data, and the perl programs all reside locally (for now anyway).
>
> Great. But irrelevant. They have to communicate via http.
-----------------
you're losing me.... please back up a half-step and be patient. I'm
hoping there are a few other people that are interesting in learning
this and are having as hard a time with the concept as I am!
My impression was that if I use a POST action from an html form, it
basically passes the variables and values to the designated program in a
particular format... which can be unraveled into an assoc array by
CGI_Lite.pm or one of serveral other modules. Am I making a rash
assumtion that I cannot use some html like:
<form method=POST action="file:/somelocalbin/someprog.pl">
<input name=firstvar size=20>
...whatever, and submit
to pass some data to my perl program?
Dan
------------------------------
Date: Wed, 15 Apr 1998 20:06:27 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: understanding Perl<->.html forms?
Message-Id: <comdog-ya02408000R1504982006270001@news.panix.com>
Keywords: from just another new york perl hacker
In article <35354721.BC1@flash.net>, dtbaker_@flash.net posted:
>John Porter wrote:
>> Great. But irrelevant. They have to communicate via http.
>you're losing me.... please back up a half-step and be patient. I'm
>hoping there are a few other people that are interesting in learning
>this and are having as hard a time with the concept as I am!
>My impression was that if I use a POST action from an html form, it
>basically
[snip]
everything you need to know is in one of the documents in the
CGI Meta FAQ, including the Perl specific references.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.pm.org>
"a mind is a terrible thing to waste"
------------------------------
Date: Wed, 15 Apr 1998 19:10:53 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: understanding Perl<->.html forms?
Message-Id: <35355A9D.59EA@flash.net>
brian d foy wrote:
>
> In article <35354721.BC1@flash.net>, dtbaker_@flash.net posted:
>
> >John Porter wrote:
>
> >> Great. But irrelevant. They have to communicate via http.
>
> >you're losing me.... please back up a half-step and be patient. I'm
> >hoping there are a few other people that are interesting in learning
> >this and are having as hard a time with the concept as I am!
>
> >My impression was that if I use a POST action from an html form, it
> >basically
> [snip]
>
> everything you need to know is in one of the documents in the
> CGI Meta FAQ, including the Perl specific references.
>
> --
> brian d foy <comdog@computerdog.com>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
> Perl Mongers <URL:http://www.pm.org>
> "a mind is a terrible thing to waste"
---------------------
I just tried the link to computerdog... host not responding right now. I
guess i'll try again later.
Dan
------------------------------
Date: 15 Apr 1998 23:28:28 GMT
From: wityshyn@telusplanet.net (Dale Wityshyn)
Subject: unpack and physical network address
Message-Id: <6h3fqs$p6b@priv-sys04-le0.agt.net>
Hi,
I have obtained a physical (MAC) address from a router via snmp.
It is a bytestring of length six. I would like to use unpack to
convert it to a printable form.
ie.
40000253745
Any suggestions on how to do this. I did read the docs and played
around a bit but haven't gotten anywhere yet.
Thanks in advance.
Dale Wityshyn
wityshyn@telusplanet.net
------------------------------
Date: Thu, 16 Apr 1998 01:04:49 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: unpack and physical network address
Message-Id: <slrn6jam49.slh.jgloudon@manitoba.bbn.com>
Dale Wityshyn <wityshyn@telusplanet.net> wrote:
.
.
>40000253745
What form is this MAC address in ? If it's a decimal representation of the 6
byte MAC address (ugh), then you could convert this to hex by repeated
division.
Here's a lazy way..I'm using Math::Bigint because the numbers we're dealing
with here are 48 bit numbers, which won't fit in normal scalar integers, and
using double's for these calculations could be messy.
#!/usr/local/bin/perl
use Math::BigInt;
$joe = new Math::BigInt "40000253745";
$abyte = new Math::BigInt "256";
for($i=0;$i<6;$i++){
($div,$quo) = $joe->bdiv($abyte);
# change unshift to change the byte order
unshift @bytes , sprintf ("%X", 0+$quo);
$joe = new Math::BigInt $div;
}
print join (':' , @bytes), "\n";
Again, this may generate complete garbage since I don't know what that number
above represents.
--
Jason Gloudon
------------------------------
Date: Tue, 14 Apr 1998 12:43:49 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Which Win32 Perl
Message-Id: <35335173.19219960@news.btinternet.com>
On Tue, 14 Apr 1998 15:41:20 GMT, gerlach@netcom.com (Matthew H.
Gerlach) wrote:
>In addition to the two versions you mention, there is DJGPP port of perl,
>www.delorie.com/djgpp/.
<snip>
Big drawback of djgpp for some would be the lack of network support,
it will run in any DPMI environment (such as Win3.1) and there is no
standard networking interface here as there is in Win32. Having said
that it is otherwise excellent - quite sufficient for the kind of
hacking I get up to at home.
For my sins I have charge of two NT machines at work and out of spirit
of curiosity they have the two different Win32 versions of Perl. I
find that the Gurusamy Sarathy version is subjectively faster than
ActiveState for CGI (IsapiPerl notwithstanding). I havent found a
script that wont run on both yet (but I rarely touch any of the heavy
Win32 tricks). I also find it more sensible to have a release that is
closer to the lastest Native distribution which is running on various
unices around the place. It should also be noted that the ActiveState
port is somewhere around 5.003.0? and a fair amount of stuff was fixed
between that and the 5.004.02 of GSAR.
In switching from ActiveState (if we disregard losing PerlScript and
IsapiPerl) there should be few problems short of fetching yourself
some of the Win32 modules from CPAN which didnt make the distribution
and perhaps any custom modules you might have acquired.
Altogether I would recommend the switch.
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: Thu, 16 Apr 1998 01:31:22 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: WIN32::Process::Create doesn't work in Win 95. Why?
Message-Id: <6h3n31$sbo$1@hirame.wwa.com>
In article <6h205d$4dt$1@nnrp1.dejanews.com>, Christo@drexel.edu wrote:
>The following perl script works fine when I run it on Win NT, but when I
>installed Perl in Win 95 it won't work. It gives me the following error:
It does? It shouldn't.
>C:\sambar\cgi-bin>perl lighton.pl
>Undefined subroutine &main::print_error called at lighton.pl line 9.
This pretty well says it. The &print_error is a call to a
subroutine which doesn't appear to exist. Change those and
it works fine for me:
#!/perl/bin/perl -w
use strict;
use Win32;
use Win32::Process;
use vars qw($ProcessObj $ExitCode);
# Create the process object.
Win32::Process::Create( $ProcessObj,
"c:\\windows\\notepad.exe",
"Win_Launcher",
0, # Don't inherit.
DETACHED_PROCESS,
".") || die print "$!\n";
# Wait for the process to end. No timeout.
$ProcessObj->Wait(INFINITE);
$ProcessObj->GetExitCode($ExitCode);
Regards,
Troy Denkinger
------------------------------
Date: Wed, 15 Apr 1998 20:50:56 +0200
From: "Thomas Nielsen" <thn@ehs.dk>
Subject: Re: Win32:GetFreeDiskSpaceEx
Message-Id: <353501b9.0@mnemosyne.ehs.dk>
Dave Roth wrote in message <01bd6815$9f6cee00$0101a8c0@main2>...
>Go and grab Win32::AdminMisc from my ftp site. Get the
>source code and look in how I did it.
Thank you. It looks a bit more promising than my own attempts.
Kind regards, Thomas Nielsen
Esbjerg Handelsskole / IT Center
------------------------------
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 2332
**************************************