[9167] in Perl-Users-Digest
Perl-Users Digest, Issue: 2785 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 2 08:18:30 1998
Date: Tue, 2 Jun 98 05:00:47 -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 Tue, 2 Jun 1998 Volume: 8 Number: 2785
Today's topics:
[Help!] : Numeric Checker wslim@my-dejanews.com
Re: [Help!] : Numeric Checker <zenin@bawdycaste.org>
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
capturing return code from shell scripts <BOLIKE@prodigy.net>
Re: capturing return code from shell scripts (Honza Pazdziora)
cgi Performance? (John McDermon)
DBM concurrent writing <webmaster@spanishbanner.com>
Help in Proxy Server GET HTTP! <e78199@ceng.metu.edu.tr>
Re: Help in Proxy Server GET HTTP! <barmar@bbnplanet.com>
Help on e-mail from PERL script. <hetlet@ptialaska.net>
Re: Help on e-mail from PERL script. (Jeremy D. Zawodny)
HOWTO: GDBM and passwd files... suave@colba.net
Is he a kook or merely a troll? Who cares? <abraham@dina.kvl.dk>
looking for DROP DOWN CATEGORY MENU (michael)
Re: looking for DROP DOWN CATEGORY MENU (Chris Nandor)
Re: Perl-Frage (J|rgen P|nter)
Programming Problems for Win NT <defaultuser@domain.com>
Re: Random permutations in Perl (Mark-Jason Dominus)
RE : [Help!] : Numeric Checker wslim@my-dejanews.com
Re: Subroutine for erasing everything in a package (Mark-Jason Dominus)
Re: Subroutine for erasing everything in a package (Chris Nandor)
User System Info. bobbybooby@my-dejanews.com
win32::NetAdmin::UserAttributes problem (Steve Heaven)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 02 Jun 1998 07:59:04 GMT
From: wslim@my-dejanews.com
Subject: [Help!] : Numeric Checker
Message-Id: <6l0bc7$meg$1@nnrp1.dejanews.com>
Hi Everyone,
I am writing a CGI script in PERL that has to check the user input that is
numeric. How to I write an elegant scipt to do that?
Acceptable Value : 1.2, +1.2, -1.2, 1, 0, -1, +1
Reject Values : abc, a12b, 1a3e, -1a, +2.a, *(dsa), ... any other combination
of non-numeric that you can think of.
Thank in advance a million!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 2 Jun 1998 08:56:27 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: [Help!] : Numeric Checker
Message-Id: <896778210.639820@thrush.omix.com>
[posted & mailed]
wslim@my-dejanews.com wrote:
: I am writing a CGI script in PERL that has to check the user input that is
: numeric. How to I write an elegant scipt to do that?
: Acceptable Value : 1.2, +1.2, -1.2, 1, 0, -1, +1
A regexp, most commonly.
<plug>
My CGI::Validate module is built for just such input validation. It
could be used like this:
use CGI::Validate qw(:standard);
addExtension (
## Default float and int types don't handle +- on the var, I'll
## fix that next release, but for now you can make your own type.
Numaric => sub { $_[0] =~ /^[+-]?\d+.?\d*$/ },
)
GetFromData (
"field_name=xNumaric" => \$SomeVarToPutItIn,
) or die "Form error: $CGI::Validate::Error;
In a simple case like this it's overkill, but for larger forms it's
very handy. Available at your local CPAN.
</plug>
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Tue, 02 Jun 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage896783041.27215@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 18 May 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Spring of
1997; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
403_662_481 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 27 May 1998 09:12:58 -0700
From: "Vijay Veeranna" <BOLIKE@prodigy.net>
Subject: capturing return code from shell scripts
Message-Id: <6kvpsv$dq6a$1@newssvr04-int.news.prodigy.com>
Hi,
I have a question about how to capture the return code from a shell
script invoked from perl. In the example below the shell script load_file.sh
is invoked from a perl script and I would like to capture the return
code from load_file.sh which is the LOAD_RESULT. Any suggestion
on how to do this is appreciated.
----------------------------------------------------------------
main.pl
!/usr/local/bin/perl
system("$EMS_SRV_ROOT/sun5/bin/load_file.sh $saved_path $validated_
path/$File $File $error_path ");
return_code = ????
----------------------------------------------------------------
load_file.sh
!/bin/sh
#Invoke sqlldr with userid/passwd control file, datafile and bad file as the
parameters
/usr/local/bin/sqlldr tiger/scott control=load_file.ctl
data=load_file.dat bad = load_file.bad
#capture the return code of sqlldr
LOAD_RESULT=$?
----------------------------------------------------------------
Thanks
vijay
P.S. Respond to vijay.veeranna@cbis.com
----------------------------------------------------------------
------------------------------
Date: Tue, 2 Jun 1998 08:27:21 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: capturing return code from shell scripts
Message-Id: <adelton.896776041@nemesis>
"Vijay Veeranna" <BOLIKE@prodigy.net> writes:
> Hi,
> I have a question about how to capture the return code from a shell
> script invoked from perl. In the example below the shell script load_file.sh
> is invoked from a perl script and I would like to capture the return
> code from load_file.sh which is the LOAD_RESULT. Any suggestion
> on how to do this is appreciated.
>
> ----------------------------------------------------------------
> main.pl
> !/usr/local/bin/perl
> system("$EMS_SRV_ROOT/sun5/bin/load_file.sh $saved_path $validated_
> path/$File $File $error_path ");
> return_code = ????
> ----------------------------------------------------------------
man perlvar, check for $? (Perl _is_ consistent ;-) Also note that you
probably want to have
$return_code = $?;
with that dollar.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Tue, 02 Jun 1998 00:14:21 -0600
From: jmcdermo@nojunk.lanl.gov (John McDermon)
Subject: cgi Performance?
Message-Id: <jmcdermo-ya02408000R0206980014210001@newshost.lanl.gov>
We recently moved our web server to a newer "bigger" machine and thr
performance has been dissapointing to say the least. Under a load I get
lots of broken pipe and cannot complete request server errors. It looks
like the "bigger" machine is either hitting memory or CPU limits, but I
can't figure out why.
The site is basically a big CGI shopping basket script for internal
electronic software distribution so right now I'm focusing on perl
performance, but my results are not what I expected.
Old Machine:
Tatung Sparc 10 clone, 70MHz CPU, 96MB RAM, older disks
perl 4.036 (actually oraperl), Netscape Commerce Server 1.1
New Machine HP K200, 100MHz CPU, 512MB RAM, 7200 RPM Baracuda disks
perl 5.004_4, DBI:DBD Oracle, Netscape Enterprise server 3.5.1
(patched for HPUX)
Tonight I ran so tets calling the main cgi from the command line and using
time to report some stats, but as I said before I didn't expect these
results:
The system load on the HP was 0.8 while the system load on the Tatung was 0
Avg StdDev | t1 t2 t3 t4 t5
HP-UX 10.20 |
real 6.1 0.0837 | 6.0 6.0 6.2 6.1 6.1
user 1.8 0.0 | 1.8 1.8 1.8 1.8 1.8
sys 0.4 0.0 | 0.4 0.4 0.4 0.4 0.4
SunOS 4.1.4 |
real 5.6 0.0837 | 5.7 5.5 5.6 5.5 5.6
user 2.2 0.0548 | 2.2 2.1 2.2 2.1 2.2
sys 0.7 0.0548 | 0.6 0.7 0.7 0.7 0.6
When I artificially create 5 simultaneously running instances of the cgi
script before timing the 6th invocation I get the following data:
HP (with nightly backup running running):
real 19.6
user 1.8
sys 0.3
Tatung:
real 19.2
user 2.2
sys 0.7
When I artificially create 10 simultaneously running instances of the cgi
script before timing the 11th invocation I get the following data:
HP (with nightly backup running running):
real 21.7
user 1.9
sys 0.3
Tatung:
real 36.1
user 2.3
sys 0.6
When I artificially create 20 simultaneously running instances of the cgi
script before timing the 21th invocation I get the following data:
HP (with nightly backup running running):
real 18.7
user 1.8
sys 0.4
Tatung:
real 1:00.3
user 2.0
sys 0.8
So, now under this artificial load it looks like the HP is holding up
better than the Tatung, but I'm not convinced this is what a user would see
through the web.
Does anybody have any suggestions or can they make sense of this better
than I'm doing right now?
Thanks,
-- john
remove the nojunk from the return address to reply via email
+-----------------------------------------------------------+
| John McDermon, jmcdermo@lanl.gov, New Mexico, USA |
| |
| "All the while I was alone, the past was close behind. |
| I've seen a lot of women, but she never escaped my mind, |
| and I just grewwww, tangled up in blue" Bob Dylan |
+-----------------------------------------------------------+
------------------------------
Date: Tue, 02 Jun 1998 08:28:11 +0000
From: webmaster <webmaster@spanishbanner.com>
Subject: DBM concurrent writing
Message-Id: <3573B79A.428175F8@spanishbanner.com>
Hi!
I'm trying to do a database system via DBM with Perl. It's just prett
yeasy but I have some troubles when accessing concurrently a database
entry. I think DBM does not cover concurrence (I'm not sure). The fact
is that I loose data when one proccess attempts to open a DBM file
previously opened by another process. The database is for storing data
of a banner-exchange system, so it has lots of concurrent accesses and
the counter data gets lost when two processes uses the same DB field to
update the data stored there.
I had tryed to lock the file by using flock, but DBM changes on
differents Perl versions an I think is not an orthodox method to do it
(of course it does not work). How can I lock the database file in order
to keep data integrity on concurrent accesses?.
Thanks in advance
Please, aswer in this newsgroup or email me to joluco@gsyc.inf.uc3m.es
------------------------------
Date: Mon, 01 Jun 1998 16:26:22 +0300
From: Walid ALSAQAF <e78199@ceng.metu.edu.tr>
Subject: Help in Proxy Server GET HTTP!
Message-Id: <3572ABFD.16AD8E1B@ceng.metu.edu.tr>
Greetings all,
I wrote a Perl script that downloads HTML files from HTTP servers using
the 80 port, and everything went find. However, in one server, such a
message appeared with the heading:
HTTP/1.1 200 OK
Date: Sun, 31 May 1998 17:21:08 GMT
Server: Apache/1.2.5
Last-Modified: Thu, 02 Apr 1998 16:16:37 GMT
ETag: "c620-476-3523b9e5"
Content-Length: 1142
Accept-Ranges: bytes
Connection: close
Content-Type: text/html
Saying that my browser is not using a proxy caching mechanism, and that
I have to set up a proxy cache connection. I am not sure what this
means? Is there a special sequence of argument instead of "GET
/index.html HTTP/1.0"
Thanks for your help in advance, if you can email me as well as
posting,..
--
/*********************************************/
Walid ALSAQAF
METU
Computer Engineering Department
mailto:e78199@ceng.metu.edu.tr
http://www.ceng.metu.edu.tr/~e78199/Walid
ICQ # : (9762042)
/*********************************************/
------------------------------
Date: Tue, 02 Jun 1998 05:58:19 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Help in Proxy Server GET HTTP!
Message-Id: <%vMc1.45$334.611627@cam-news-reader1.bbnplanet.com>
In article <3572ABFD.16AD8E1B@ceng.metu.edu.tr>,
Walid ALSAQAF <e78199@ceng.metu.edu.tr> wrote:
>Saying that my browser is not using a proxy caching mechanism, and that
>I have to set up a proxy cache connection. I am not sure what this
>means? Is there a special sequence of argument instead of "GET
>/index.html HTTP/1.0"
When you use a proxy server, you have to send the full URL in the command,
e.g.
GET http://servername/index.html HTTP/1.0
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: Mon, 01 Jun 1998 19:01:13 -0800
From: Lance Hetlet <hetlet@ptialaska.net>
Subject: Help on e-mail from PERL script.
Message-Id: <35736AF9.56568A33@ptialaska.net>
I need help in e-mailing from my script. I have had it successfullye-mail users, but the format is
unprofessional as seen below. Can
anyone direct me in the right directions (URL's, books, advice)
to where I can give it the appearance of any regular e-maill message?
tia.
> >From hetlet Fri May 29 03:17 EDT 1998
> Content-Type: text
> Content-Length: 230
>
> <message>
Lance Hetlet
http://www.ptialaska.net/~hetlet
------------------------------
Date: 02 Jun 1998 00:00:28 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Help on e-mail from PERL script.
Message-Id: <m3btscv4f7.fsf@peach.z.org>
Lance Hetlet <hetlet@ptialaska.net> writes:
> I need help in e-mailing from my script. I have had it
> successfullye-mail users, but the format is unprofessional as seen
> below. Can anyone direct me in the right directions (URL's, books,
> advice) to where I can give it the appearance of any regular e-maill
> message?
There are several Mail-related modules on CPAN, if you look. Some that
to SMTP, some that do MIME, some that do POP, and so on. Surely one of
them (probably SMTP) will fit the bill.
> > >From hetlet Fri May 29 03:17 EDT 1998
> > Content-Type: text
> > Content-Length: 230
> >
> > <message>
What does a "regular" message look like? How is it different? I'm just
trying to get you to articulate your goal(s), because I could be a bad
guesser.
If you have no trouble *sending* the mail, and you're just worried
about *formatting* the mail, those modules may not be of much
assistance. Then again, I could be wrong. It's been many months since
I used the SMTP module, for example.
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Tue, 02 Jun 1998 02:22:09 -0400
From: suave@colba.net
Subject: HOWTO: GDBM and passwd files...
Message-Id: <35739A11.48934A0@colba.net>
Since I can't seem to find the right place to put this question, I guess
I'll throw it in here.
My problem:
I'm working on making a CGI application to do automate certain everyday
tasks, and have been trying to figure out how to access the passwd file
for reading/writing in perl. I have very good reason to believe that the
system is using a GDBM passwd file and the normal run of the mill
passwd.byname and passwd.byuid. Because the system is running ypserv
over several machines, I have to open up all three files for read/write,
make the wanted changes, and save all the information. I've tried going
about it the following way without success:
#!/usr/bin/perl -w
#so far so good :)
use GDBM_File;
if (-e "/mypath/passwd && -R "/mypath/passwd" && -W "/mypath/passwd") {
# If it's gotten this far, the file exsists, and is read/write
tie %PASS, "GDBM_File", "/mypath/passwd", 1, 1 || die "couldn't open the
passwd file: $!";
foreach $key (keys %PASS) {
print "$key has value of $PASS{$key}\n";
}
#so far not so good
Every time I try to run this program, I get couldn't open the passwd
file : no such file or directory.
I've changed the permissions/ownership of the passwd file to wide open
read/write/execute, done the same to my perl script, directory,
directory tree, I've even tried the same script on other GDBM files, and
undoubtedly lost too much sleep over what is probably a typo in the
code. Can someone clue me in as to what i'm doing wrong here?
Now my system administrator keeps telling me how much easier it would be
to do this in C, and to prove it to me he's done it in C. For all
practical purposes, his source code looks pretty much the same, yet his
works, and is being run from the web server (nobody), and mine doesn't
when I'm trying to run it from root.
------------------------------
Date: 02 Jun 1998 13:33:39 +0200
From: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: Is he a kook or merely a troll? Who cares?
Message-Id: <rjra18kpgs.fsf@zuse.+dina.kvl.dk>
[ FUT: gnu.misc.discuss ]
Russ Allbery <rra@stanford.edu> writes:
> Then why don't you limit your judgements to the postings, which you can
> see, and refrain from judging the person, whom you cannot?
Can you ever really judge another person for what he is? Or can you
only judge his actions? If the later, what use is the distinction?
------------------------------
Date: Tue, 02 Jun 1998 04:22:49 GMT
From: michael@wwwebcrafters.com (michael)
Subject: looking for DROP DOWN CATEGORY MENU
Message-Id: <6kvukl$hfs$1@supernews.com>
Hi folks,
I'm trying to find a drop down menu in which I can link the selected
items to different URL's.
Any help, advice, direction will be greatly appreciated.
Please e-mail to michael@wwwebcrafters.com
Thank you,
Michael
------------------------------
Date: Tue, 02 Jun 1998 11:46:04 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: looking for DROP DOWN CATEGORY MENU
Message-Id: <pudge-0206980740240001@192.168.0.3>
In article <6kvukl$hfs$1@supernews.com>, michael@wwwebcrafters.com
(michael) wrote:
# I'm trying to find a drop down menu in which I can link the selected
# items to different URL's.
What does this have to do with Perl?
# Any help, advice, direction will be greatly appreciated.
Sure, go to the appropriate newsgroups.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 2 Jun 1998 06:50:11 GMT
From: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: Re: Perl-Frage
Message-Id: <6l07b3$qi8$1@penthesilea.Materna.DE>
In article <3570b51f.53672600@news.btinternet.com>, Gellyfish@btinternet.com
says...
>
>That will be ( courtesy of: http://babelfish.altavista.digital.com ):
[snip horrible translation]
>I didnt like the bit where it says " the user must die" - but hey this
>guy probably works for Microsoft (or IG Farben)..
Argh, please do not post machine-generated translations if you do not
have any chance/knowledge to check them. To correct this mess, I've
included my own translation - you'll notice that there is nothing like
'die' in it (and it's neither in the original post). Of course, the
original poster should've posted in english right away, but that is
another thread.
Here goes:
"Dear News-Reader
Perhaps someone of you can help me.
I plan to allow the use of a certain Perl-program in exchange for a
small payment, provided the user of the program accepts this payment.
[this sounds a bit strange, but so does the german original]
However, the user is not obligated to pay, i.e. should he 'forget'
to pay, there will be no consequences. That is, I trust in the user's
honesty.
To nonetheless improve the user's 'desire to pay' I'd like to send him
an automatically generated email as a friendly reminder, with my
bank-account included.
['desire to pay' is my wording, is there something like 'payment-
moral' in english?]
I already tried scripts like 'SendMail.pl', but I quickly reach the
point where I'm stuck.
Question: do you know anybody who could implement this function?
Which requirements are there for my environment/provider/webhost?
Is there some specific software which has to be installed on the
host?
And most important: how much would it cost to have this function
coded into my pages by a programmer?
I hope you can help me, TIA.
Oehms"
There - not perfect by far but much better. Sorry for posting this
one more time, but perhaps now the original poster will find the
help he needs.
Have a nice day
Juergen Puenter
------------------------------
Date: Tue, 02 Jun 1998 11:51:35 +0800
From: EEE Computing Lab <defaultuser@domain.com>
Subject: Programming Problems for Win NT
Message-Id: <357376C7.E475C198@domain.com>
I need to write a Perl Script for a program to scan files on a drive
to detect :
1. which version of the windows NT is being run
2. any service packs/hot fixes installed
3. illegal software installed in the system(e.g. "back door", trojan
horse,
etc)
The program may be web-based and has to run on Win NT 4.0
My problem is that i dont know how to set about doing this since my
experience in Perl is pretty basic. Any idea how to go about
it, or are there such scripts available anywhere on the web?
Hope that you will reply soon.. thanks.. your help would be very much
appreciated...
Problem Child
please email to: bn770521@ntu.edu.sg
------------------------------
Date: 2 Jun 1998 02:40:48 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Random permutations in Perl
Message-Id: <6l06pg$hdb$1@monet.op.net>
Keywords: armpit comfort Oresteia thrust
In article <lzyu364vn1j.fsf@babylon5.unity.ncsu.edu>,
William P Setzer <William_Setzer@ncsu.edu> wrote:
> my $P = int rand $N--;
>
> @perm[$N, $P] = @perm[$P, $N];
`int' here is superfluous. Array indices get int-ed automatically.
This method is better in many ways, but I don't like it as much
because it doesn't generate the permutations in lexicographic order.
------------------------------
Date: Tue, 02 Jun 1998 08:14:56 GMT
From: wslim@my-dejanews.com
Subject: RE : [Help!] : Numeric Checker
Message-Id: <6l0c9v$nbn$1@nnrp1.dejanews.com>
Sorry Folks to waste bandwidth like this, found the answer in FAQ, but don't
know how to cancel the previous article from my news poster.
A billion apologies ;-).
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 2 Jun 1998 02:47:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Subroutine for erasing everything in a package
Message-Id: <6l075s$hf9$1@monet.op.net>
Keywords: cornerstone inaccurate Rothschild scripture
In article <pudge-0106981155130001@192.168.0.3>,
Chris Nandor <pudge@pobox.com> wrote:
>What is wrong with the reset 'A-Za-z_' version
There are several reasons.
One is that the package might have stuff in it that doesn't begin with
a letter, and the code I showed will get rid of it, but the `reset'
version doesn't.
Another reason is that `eval' gives me the heebie-jeebies.
Another reason (the real reason) is that `reset' doesn't eliminate
subroutines.
I think there might be another reason, but I forget because it's
almost 3 AM here.
> (aside from yours not having an underscore :)?
I forgot the underscore.
> Or are you just showing off? :-)
I'm not *just* showing off.
This time.
------------------------------
Date: Tue, 02 Jun 1998 11:48:51 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Subroutine for erasing everything in a package
Message-Id: <pudge-0206980743110001@192.168.0.3>
In article <6l075s$hf9$1@monet.op.net>, mjd@op.net (Mark-Jason Dominus) wrote:
# One is that the package might have stuff in it that doesn't begin with
# a letter, and the code I showed will get rid of it, but the `reset'
# version doesn't.
Maybe it is just early, but what could it start with if not [A-Za-z_]?
# Another reason is that `eval' gives me the heebie-jeebies.
Yeah, but globs also give me the willies.
# Another reason (the real reason) is that `reset' doesn't eliminate
# subroutines.
Ahhh. Good reason.
* ^Pudge goes back and gets mjd's code ...
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Tue, 02 Jun 1998 06:11:37 GMT
From: bobbybooby@my-dejanews.com
Subject: User System Info.
Message-Id: <6l052o$eb3$1@nnrp1.dejanews.com>
I'm sure that I have the totally wrong group, but I'll go for it anyway.
I've seen a couple of postings related to using JavaScript and Java to obtain
Screen Size information from the user's system. However, none of these is
working with what I want.
If you check out www.anonymizer.com and click on the "What we know about you"
link. You'll see information presented that typically isn't anything new.
However, the screen size baffled me as well as the processor.
They are NOT using JavaScript. It seems to be something with a SSI or CSI.
I've seen the script called with both the .cgi and .pl extension, although
that doesn't mean much. I don't think you can do this with just perl can
you? I've been into perl for a while now and either haven't delved in that
far or missed it somewhere.
Any help out there, this has been killing me today trying to come up with a
script that works. I'm being adamant because I'm using IE3.02 (client uses
this) and none of the Java/JavaScript examples work. The one on anonymizer
is the only one that does!
bb
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 2 Jun 1998 11:36:28
From: sheaven@crossings.u-net.com (Steve Heaven)
Subject: win32::NetAdmin::UserAttributes problem
Message-Id: <sheaven.408.000B9BED@crossings.u-net.com>
Hi
When trying to use Win32::NetAdmin::UserAttributes I always get a null string
for the password. Even if I am trying to read the attributes of the user who
is running the script.
The test file netadmin.t seems to work, but only because it uses a null
password.
I am trying to write a simple tcp authenication server. i.e. given a username
ann a p/w, respond with a yea or nay.
Steve
------------------------------
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 2785
**************************************