[10879] in Perl-Users-Digest
Perl-Users Digest, Issue: 4480 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 22 14:07:36 1998
Date: Tue, 22 Dec 98 11:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 22 Dec 1998 Volume: 8 Number: 4480
Today's topics:
Re: $var->$method vs $var->$method() (M.J.T. Guy)
Re: 'make test ' to test Oracle connectivity using DBD <newsposter@cthulhu.demon.nl>
Active Perl & DBI||DBD... evlap@usa.net
Big-Endian to Little-Endian <tlynch@cisco.com>
CGIwrap error What's up? <chidr@ix.netcom.com>
Re: Exit status from piped commands <jeromeo@atrieva.com>
Re: Exit status from piped commands (Clay Irving)
Re: help!!! <newsposter@cthulhu.demon.nl>
Re: howto "fool" browser? <newsposter@cthulhu.demon.nl>
Installing Perl on Windows 95 or Windows 98 <fguarner@ix.netcom.com>
Re: Nested sorting (Larry Rosler)
NT login script to query group membership.... (Mjd440)
Re: Perl 5.005_002 and berkeley db problems <colin@iscusa.com>
Perl and As400 <len@buffnet.net>
Re: Perl/Java cgi script with pws scott@softbase.com
Problem with PPM kate_stafford@my-dejanews.com
Re: Q: is srand(time()); good enough? (Greg Ward)
Re: Q: is srand(time()); good enough? (Larry Rosler)
Re: Q: is srand(time()); good enough? <rra@stanford.edu>
Re: Real Newbie--please help <ajonsson@csi.com>
Re: Real Newbie--please help <newsposter@cthulhu.demon.nl>
Re: Retrospective on comp.lang.perl.moderated? ptimmins@netserv.unmc.edu
Re: Running Perl for Win32 -- Beginner Question <ebohlman@netcom.com>
scoped references <ruben@llinderman.dental.nyu.edu>
Re: scoped references (Mark-Jason Dominus)
Re: scoped references <ruben@llinderman.dental.nyu.edu>
Script To return 'do nothing' (Nick Vega)
Re: Script To return 'do nothing' (Greg Ward)
Re: Script To return 'do nothing' <flavell@mail.cern.ch>
Searching for wildcard characters <see@bottom.of.sig>
Re: Sendmail <JeremyB@clear.net.nz>
sizeof() function? <sean@youknowwhattoremove.weblabs.com>
Re: sizeof() function? (Greg Ward)
sorting <cswfrank@rica.net>
Re: Turning Variables into CAPS? <kenhirsch@myself.com>
Re: Why does my browser try to download the script inst <newsposter@cthulhu.demon.nl>
Re: Why does my browser try to download the script inst (brian d foy)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Dec 1998 16:11:25 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: $var->$method vs $var->$method()
Message-Id: <75ogbd$auv$1@pegasus.csx.cam.ac.uk>
Martin GOLDSTERN <goldstrn@mail.zserv.tuwien.ac.at> wrote:
>
>Why doesn't perl allow the form without parentheses if the method is
>given by a variable?
This is a long standing bug. Stephen McCamant has recently provided a
patch in
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-12/msg01136.html
so it should be mended in the next maintenance releases 5.004_05 and
5.005_03.
Mike Guy
------------------------------
Date: Tue, 22 Dec 1998 11:35:04 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: 'make test ' to test Oracle connectivity using DBD fails
Message-Id: <367FCA36.FFBD5C7B@cthulhu.demon.nl>
Asha Bageshpura wrote:
>
> Hi,
> I have installed DBD Oracle . I tried to use 'make test' and it
> fails with the following
> error messages
>
> make test
> PERL_DL_NONLAZY=1 /log/perlmodules/perl4/bin/perl -I./blib/arch
> -I./blib/lib -I/
> log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
> -I/log/perlmodules/perl4/lib -e
> 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
> t/*.t
> t/base..............Can't locate DBI.pm in @INC (@INC contains:
This suggests you should install the appropriate DBI module.
Erik
------------------------------
Date: Tue, 22 Dec 1998 18:08:38 GMT
From: evlap@usa.net
Subject: Active Perl & DBI||DBD...
Message-Id: <75on74$lsc$1@nnrp1.dejanews.com>
Hi!
I address to anybody who works with ActivePerl (win32). Have you got
DBI & DBD:Oracle already compiled? Actually they are both included in QubPerl
however I like visual ActiveState debugger etc and need this packages there.
regards.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 22 Dec 1998 11:19:43 -0500
From: Tom Lynch <tlynch@cisco.com>
Subject: Big-Endian to Little-Endian
Message-Id: <367FC69F.9BBE8894@cisco.com>
Greetings:
I have a 32 bit Hex number which is
Big-endian and I need to convert to
Little-endian (i.e. 0001dc68 to 163b800).
I seem to be having problems with pack:
$little = (pack ('V*', unpack ('N*', $ARGV[0])));
print ("$little\n");
When I run the program I get:
100086cd
which is converting on 16 bit boundries. Any
ideas how to fix this. Thanks in advance for
any help!
Tom
--
#-----------------------+--------------------------+
# Tom Lynch | Email: tlynch@cisco.com |
# Cisco Systems | Phone: 978-244-8765 |
# 250 Apollo Drive | FAX: 978-244-8039 |
# Chelmsford MA 01824 | MS: CH1-2LF |
#-----------------------+--------------------------+
------------------------------
Date: Mon, 21 Dec 1998 18:37:07 -0600
From: Cody <chidr@ix.netcom.com>
Subject: CGIwrap error What's up?
Message-Id: <367EE9B3.68413D77@ix.netcom.com>
Learning perl/cgi from a teach yourself book and am having
problems running my first script. I followed all the
directions in the book and have ftp'd the file correctly to
my cgi-bin. The darn thing won't run from a browser
though. I keep getting this error.
What's this mean? I thought it might be my text editor
(notepad), so I downloaded the trial version of UltraEdit.
Wow, what a program. Same problem.
Help me, please.
Cody
------------------------------
Date: Tue, 22 Dec 1998 08:21:13 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Jonathan Nicholson <jjn@sanger.ac.uk>
Subject: Re: Exit status from piped commands
Message-Id: <367FC6F9.4B0A06F9@atrieva.com>
Jonathan Nicholson wrote:
> That's the point of the exercise. I need to be able to get both the
> STDOUT from the subprogram as well as it's exit status.
Use backticks to capture the output, and check $? for the exit status.
perldoc perlvar for more information on useful variables.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 22 Dec 1998 11:47:17 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Exit status from piped commands
Message-Id: <75oiel$r5l@panix.com>
In <367FB9E0.B960165A@sanger.ac.uk> Jonathan Nicholson <jjn@sanger.ac.uk> writes:
>Clay Irving wrote:
>> #!/usr/local/bin/perl -w
>>
>> $status = system("./foo.pl");
>> print "$status\n";
>>
>Yes yes yes, that's all very well, but you cannot capture the output
>of the system'd program into an array to process later.
>That's the point of the exercise. I need to be able to get both the
>STDOUT from the subprogram as well as it's exit status.
That's why I gave the example using backticks...
Like this one:
#!/usr/local/bin/perl5.00403 -w
@ls = `lsx`;
if ($?) {
print "$? - It didn't work...\n";
} else {
print "$? - It worked\n";
print "@ls\n";
}
>I do need to know the signal that it was sent as it is possible for
>a sig term to be sent to the program and for it to exit with zero
>status. A signal but no status would indicate an error condition as
>well as a non zero exit.
Eh?
--
Clay Irving
clay@panix.com
------------------------------
Date: Tue, 22 Dec 1998 11:08:55 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: help!!!
Message-Id: <367FC415.FB8D8079@cthulhu.demon.nl>
brian d foy wrote:
>
> In article <75m20m$f4j$1@nnrp1.dejanews.com>, nguyen.van@imvi.bls.com posted:
>
> > $view_all = $query->param('see'); $date = ParseDate('$view_all'); #if
> > (!$date) #{ # print "Bad date string: $date\n"; #} #else #{ my ($year,
> > $month, $day) = UnixDate($date, "%Y", "%m", "%d"); # print
> > "$year\t$month\t$day\n"; if ( -e "$event_dir/event_log.$month$day$year" ) {
> > open ( FROM_EVENT_LOG, "<$event_dir/event_log.$month$day$year") or die "co
>
> i think your script is missing line breaks (and maybe carriage returns
> depending on your platform). did you seriously expect anyone to try to
> decipher this morass?
Also, a description of _what_ does not work would make people more
willing to help :)
Erik
------------------------------
Date: Tue, 22 Dec 1998 11:11:17 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: howto "fool" browser?
Message-Id: <367FC4A3.A465CA64@cthulhu.demon.nl>
Martin Steffensen wrote:
>
> I am making a shopping system and the problem is this.
> I have three frames (lets call them 1,2 and 3) frame 2 shows the content
> of the shopping cart and frame 3 cantains links to my buy.cgi script.
> The llinks in frame three look like this
> <A HREF="myserver/cgi-bin/buy.cgi?9" TARGET="2">buy produkt nr 9</A>
> Now i want the base of frame 2 to be the script show_cart.cgi and not
> buy.cgi?9 because then this casues produkt nr 9 to get added to the cart
> if i use the reload or forward-back buttons of the browser. I have seen
> this on the net but don4t know how to do it. I know I am reinventing the
> weel by making a shoppingsystem but i am doing it as A learning
> expirience.
You may get more useful responses if you post your message on newsgroups
related to cgi/html/browser.
Erik
------------------------------
Date: Mon, 21 Dec 1998 23:42:55 -0500
From: "fguarner" <fguarner@ix.netcom.com>
Subject: Installing Perl on Windows 95 or Windows 98
Message-Id: <75n7s6$p8@sjx-ixn10.ix.netcom.com>
I am fascinated with learning perl, but I don't have a clue how get an
compatible version. I've read some discouraging stuff about installing perl
on Windows 95. Is there a version out there somewhere thats semi easy to
install and works.
Please email me at fguarner@ix.netcom.com
------------------------------
Date: Tue, 22 Dec 1998 10:14:29 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Nested sorting
Message-Id: <MPG.10e9815c6135525b9898e2@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <wsmyao0h69a.fsf@hzsac328.nl.lucent.com> on 22 Dec 1998
10:32:01 +0100, Micha3 Rutka <rutka@lucent.com> says...
+ lr@hpl.hp.com (Larry Rosler) writes:
+ > In article <wsmbtkxirqa.fsf@hzsac328.nl.lucent.com> on 21 Dec 1998
+ > 13:50:37 +0100, Micha3 Rutka <rutka@lucent.com> says...
+ > MR> ... Here is how you can sort floats (non-negative):
+ > MR>
+ > MR> @sorted_array_by_floats = map { substr($_,4) }
+ > MR> sort
+ > MR> map {
+ > MR> pack("f",extract_float_from($_)).$_ }
+ > MR> @unsorted_array_containing_floats;
+ > MR>
+ > MR> Simple, isn't it?
+ >
+ > Simple, but not portable.
+
+ True and obvious for somebody who understands the code, :-). I
+ intentionally not mentioned non-portability in my post.
It is hard to read someone's non-thoughts!
...
+ > That hardly seems necessary. I can't imagine what your 'if-then-
+ > else and xor' would do, in any case. But how about a
+ > portable solution for floating-point numbers, unsigned or signed?
+
+ Here it is (for unsigned, signed case is a simple excercise):
If you have a simple way for the signed case, please show it to us.
+ @sorted_array_by_floats = map { substr($_,4) }
+ sort
+ map {
+ ($big_endian?pack("f",extract_float_from($_)):
+ swap(pack("f",extract_float_from($_)))
+ ).$_
+ }
+ @unsorted_array_containing_floats;
+
+ where swap() is:
<SNIP implementation (via a loop on substr) of the 'reverse scalar'
function>
+ and $big_endian points on machine architecture. It can be a portable
+ function too (simple one), but as used in the map loop it is better to
+ use an initialized variable (can be initialized by the function).
The variable can be initialized by a simple experiment, for example,
$big_endian = pack('L', 1) eq pack('N', 1);
+ The code is portable now, but slower.
It needn't be significantly slower. I gave you the clue in my post,
which you snipped:
+ > One then has to reverse the bytes in the packed representation.
`perldoc -f reverse` and look at the behavior for a scalar argument.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 22 Dec 1998 18:06:01 GMT
From: mjd440@aol.com (Mjd440)
Subject: NT login script to query group membership....
Message-Id: <19981222130601.25117.00000156@ng127.aol.com>
Hi folks,
I need to change my login script so drives are mapped according to what
groups a user belongs to. The NT resource kit has some utilities that will
take care of this for me, but they don't work for Win95 users. Is there way I
can get this info into my login script?
Thanks for any suggestions.
Cheers,
Mark
------------------------------
Date: Tue, 22 Dec 1998 10:32:05 -0800
From: Colin Earl <colin@iscusa.com>
Subject: Re: Perl 5.005_002 and berkeley db problems
Message-Id: <367FE5A5.FC256712@iscusa.com>
Hi Pete,
You might consider switching to mySQL or similar even if the
tests all work. We found some severe bugs in Berkeley DB that were not exposed by
any of the tests.
Raphael
> Hi
>
> We run a tape backup programme which used perl with the Berkeley DB
> routines. The database needs to be shared between linux and SunOS 4.1.3.
>
> The linux perl uses Berkeley db version 2, and runs with no problems. However,
> trying to compile the Sun version of perl 5.005_002 with the version 2 db
> libraries causes the db-* tests to fail fairly early on.
>
> I have seen a few other posts referring to this problem, but no solutions.
> Has this problem been solved (or is it a configuration problem on my part) ?
>
> Regards,
> Pete
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 22 Dec 1998 13:27:13 -0500
From: "Len" <len@buffnet.net>
Subject: Perl and As400
Message-Id: <367fe457.0@news3.buffnet.net>
I've recently restored object perlpgm.savf file to a V4R1 As400. While
trying to execute "call pgm(perl5/perl) parm('/QopenSys/test.pl') got the
following error "Cannot resolve to object QCPA, type and subtype x'0401' and
authority x'0000' " . Got a suggestion about restoring object persrc.savf,
but there's no ILE/C compiler on the machine.
Does anyone have any ideas or help to get me started with Perl5 on the
As400?
------------------------------
Date: 22 Dec 1998 17:27:49 GMT
From: scott@softbase.com
Subject: Re: Perl/Java cgi script with pws
Message-Id: <367fd695.0@news.new-era.net>
Paul Chapin (pdchapin@unix.amherst.edu) wrote:
> @results=`perl test.pl`;
> I get the same results - runs fine from a DOS prompt but hangs (no error
> reported) when run from PWS.
I have never been able to get spawning an external process from a CGI
program to work with PWS. It likely is simply just not going to be
possible. PWS will run small, normal CGI programs but not complex ones
that depend on calling external programs.
Scott
------------------------------
Date: Tue, 22 Dec 1998 17:56:15 GMT
From: kate_stafford@my-dejanews.com
Subject: Problem with PPM
Message-Id: <75omfu$lam$1@nnrp1.dejanews.com>
I've been using ActiveState version 5.005_02 on NT and the Perl Package
Manager with no problem for awhile until today. When I try to run the verify
command with PPM, I get the following error:
no element found at line 1, column 0, byte -1 at
D:\Perl\site\lib/XML/Parser.pm line 117
I tried to replace the XML-Parser module but get the same message. I have
uninstalled and reinstalled a dozen times, but I still get the message. I've
noticed that the uninstall sucks, for lack of a better way to put it, and
there are several entries left behind in the registry. Is it possible that
something in there has been corrupted?
Any help would be appreciated. I really use this feature of Perl often and I
need it functional!
Thanks in advance
--
Kate Stafford, MCSE
ICQ 12183309
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Dec 1998 17:16:11 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Q: is srand(time()); good enough?
Message-Id: <75ok4r$k95$2@news0-alterdial.uu.net>
wyndo@cxo.com <wyndo@cxo.com> wrote:
> I guess my only question is, is seeding with time() sufficient? All I really
> care is that the first random # generated could potentially be any number in
> the range, and that repeated calls to rand() would return a fairly
> distributed (give or take) range of randoms. In all my testing, this seems to
> be the case. Is there a better seed to use other than time() without using a
> module (TrulyRandom, or any other)?
I have a dim and distant recollection of Randall Schwartz posting advice
along the lines of "don't seed with just 'time' -- use 'time ^^ $$'",
ie. mix another predictably-varying value (the process id) in with an
XOR. Of course, both the time and the process id vary in an extremely
predictable way, and only in the lower couple of bits. For serious
random number applications (eg. Monte Carlo simulation), I don't think
they're enough. YMMV...
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Tue, 22 Dec 1998 10:32:42 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: is srand(time()); good enough?
Message-Id: <MPG.10e985a0be20fc879898e4@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <75ok4r$k95$2@news0-alterdial.uu.net> on 22 Dec 1998 17:16:11
GMT, Greg Ward <gward@thrak.cnri.reston.va.us> says...
> wyndo@cxo.com <wyndo@cxo.com> wrote:
> > I guess my only question is, is seeding with time() sufficient? All I really
> > care is that the first random # generated could potentially be any number in
> > the range, and that repeated calls to rand() would return a fairly
> > distributed (give or take) range of randoms. In all my testing, this seems to
> > be the case. Is there a better seed to use other than time() without using a
> > module (TrulyRandom, or any other)?
>
> I have a dim and distant recollection of Randall Schwartz posting advice
> along the lines of "don't seed with just 'time' -- use 'time ^^ $$'",
This is, of course, a syntax error. Probably you meant 'time ^ $$'.
But `perldoc -f srand` says this:
Frequently called programs (like CGI scripts) that simply use
time ^ $$
for a seed can fall prey to the mathematical property that
a^b == (a+1)^(b+1)
one-third of the time. So don't do that.
> ie. mix another predictably-varying value (the process id) in with an
> XOR. Of course, both the time and the process id vary in an extremely
> predictable way, and only in the lower couple of bits. For serious
> random number applications (eg. Monte Carlo simulation), I don't think
> they're enough. YMMV...
`perldoc -f srand` for an insightful discussion of this problem.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 22 Dec 1998 10:48:08 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Q: is srand(time()); good enough?
Message-Id: <yl67b4109j.fsf@windlord.stanford.edu>
Greg Ward <gward@thrak.cnri.reston.va.us> writes:
> I have a dim and distant recollection of Randall Schwartz posting advice
> along the lines of "don't seed with just 'time' -- use 'time ^^ $$'",
> ie. mix another predictably-varying value (the process id) in with an
> XOR. Of course, both the time and the process id vary in an extremely
> predictable way, and only in the lower couple of bits. For serious
> random number applications (eg. Monte Carlo simulation), I don't think
> they're enough.
If you're using a recent Perl, don't bother using srand at all; Perl will
seed the random number generator for you with a fairly decent seed
(although not crypto-worthy).
--
#!/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: Tue, 22 Dec 1998 10:14:15 -0600
From: "AJ" <ajonsson@csi.com>
Subject: Re: Real Newbie--please help
Message-Id: <eWXvfYcL#GA.267@nih2naab.prod2.compuserve.com>
I'm not sure why your path is failing. 1) are you invoking the "perl.exe"
explictly everytime your run script?. i.e. "perl whateverscript.pl".
The command line cannot associate with the "pl" extension.
2) one cheat is to make a copy of the contents of \perl5\bin into your
\windows\command directory, which will make it universal (I'm just not sure
what it would do to stuff perl calls while it runs).
3) Is that path in your Autoexec exactly match the perl directory structure?
(I've been hosed on this one a couple of times).
Good luck!
AJ
Anna Shparberg wrote in message <367FBBF5.9734C87F@indiana.edu>...
>Help! This is a real newbie question!
>
>I have just started learning Perl, and it's my first programming
>language. So far I've had no problems with writing and executing a few
>simple programs (my platform is Windows95). What annoys me is having to
>store and run them in perl5\bin, otherwise they won't run at all. My
>path in the autoexec.bat file is set like this:
>path %path%;C:\Perl5\perl5\bin;
>
>How do I run Perl from another directory?! Please don't laugh at me!
>
>Thanks,
>
>Anna
>
------------------------------
Date: Tue, 22 Dec 1998 11:57:28 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Real Newbie--please help
Message-Id: <367FCF76.BAECBD9E@cthulhu.demon.nl>
Anna Shparberg wrote:
>
> Help! This is a real newbie question!
> I have just started learning Perl, and it's my first programming
> language. So far I've had no problems with writing and executing a few
> simple programs (my platform is Windows95). What annoys me is having to
> store and run them in perl5\bin, otherwise they won't run at all. My
> path in the autoexec.bat file is set like this:
> path %path%;C:\Perl5\perl5\bin;
>
> How do I run Perl from another directory?! Please don't laugh at me!
You can always type the full path. Eg, if you have a perl script
'c:\users\erik\news\check.pl' you could do 'perl c:\users\erik\news\check.pl'
Or if your current directory is 'c:\users\erik', you could do
'perl news\check.pl'.
The 'path' is just a standard place for looking for programs. You could
add more directories to it. Eg,
path %path%;C:\Perl5\perl5\bin;C:\users\erik\bin;
I hope this helps you,
Erik
------------------------------
Date: Tue, 22 Dec 1998 16:52:30 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <75oiod$hpq$1@nnrp1.dejanews.com>
In article <368078a3.2905811@news.ozemail.com.au>,
dac@NO.S.P.A.M.pcug.org.au (David Andrew Clayton) wrote:
> place to "hang out". After they stopped oinking in .misc and left the
> 'endless tides of clueless gits' to their own devices, the .misc group
> boomed and roared with actual information transfer, instead of snide
> references to cluelessness, or supercilious allegations of inability
> to read, ad fucking nauseum.
The last sentence makes me laugh out loud ... not in regard to it's content
but just the language ... it sounds like the narration of a children's
bedtime story that Jack might read to his "hunters" in William Golding's
"Lord of the Flies" ... hey! I have the conch!
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 21 Dec 1998 10:34:55 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Running Perl for Win32 -- Beginner Question
Message-Id: <ebohlmanF4B9E7.DKy@netcom.com>
Stephen C. Smith <homeplate@halostorm.com> wrote:
: I've tried that. I still get the message, "This program cannot
: be run in DOS Mode." It only seems to work if executed through Win95
: Explorer.
The problem is that the default setting in Win95 is for the "MS-DOS
prompt" item on the start menu to put the machine in "DOS mode" (a
compatibility mode intended for games and the like) rather than simply
giving a command prompt. In DOS mode only DOS programs can run, not
Windows console applications like perl.
To fix this, use Explorer to go into the 'start menu' subdirectory of
your Windows directory, find the item for the DOS prompt, right-click on
it and select properties, select the "program" tab, press the "advanced"
button, and uncheck the "use MS-DOS mode" box. This will give you a
proper console prompt from now on.
------------------------------
Date: Tue, 22 Dec 1998 12:06:45 -0500
From: Ruben I Safir <ruben@llinderman.dental.nyu.edu>
Subject: scoped references
Message-Id: <367FD1A5.E18C0558@llinderman.dental.nyu.edu>
Is there a way to ensure lexical scope for anonymous arrays?
If I have something like this in a subroutine:
$build{cols}[$i] = "$table" . "\." . "$column";
does
declaring my (%build); assure that
$build{cols}[$i] is also local scope?
Ruben
------------------------------
Date: 22 Dec 1998 12:11:31 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: scoped references
Message-Id: <75ojs3$4bi$1@monet.op.net>
In article <367FD1A5.E18C0558@llinderman.dental.nyu.edu>,
Ruben I Safir <ruben@llinderman.dental.nyu.edu> wrote:
>Is there a way to ensure lexical scope for anonymous arrays?
You are confused, and this question has no answer.
Scope is the lexical part of the program source code in which the name
is valid. Duration is the period of time in the program's execution
during which the variable exists.
Names have scope; variables have duration. An anonymous array is a
variable, and has a duration, but it does not have a name, so it is
meaningless to ask for lexical scope for it. It is sort of like
asking if there is a way to guarantee lexical scope for a `while'
loop: There's no answer because the question doesn't make any sense.
>If I have something like this in a subroutine:
>$build{cols}[$i] = "$table" . "\." . "$column";
>
>does declaring my (%build); assure that $build{cols}[$i] is also
>local scope?
Maybe it would be better if you would explain what you're really
afraid of, or what you think might happen. Try to stay away from the
word `scope'.
------------------------------
Date: Tue, 22 Dec 1998 14:15:49 -0500
From: Ruben I Safir <ruben@llinderman.dental.nyu.edu>
Subject: Re: scoped references
Message-Id: <367FEFE5.7D09362D@llinderman.dental.nyu.edu>
Right
100%
When the lexically scoped object goes out of scope, the references that
are insi
it's values get destroyed. BUT references and the actual objects they
point to
I'm using mod_perl cgi's which stay alive. If all we are doing is
dereferencing
anonymous objects, I can be creating an awesome memory leek.
Ruben
~
~
------------------------------
Date: Tue, 22 Dec 1998 16:23:22 GMT
From: nickvega@hotmail.com (Nick Vega)
Subject: Script To return 'do nothing'
Message-Id: <367fc497.66803464@nntp.best.com>
I'm using a perl script to redirect (drop down menu) to another URL
from an HTML page via action post. What I want to do is to have the
script return a 'do nothing' command to the browser when no URL or
some hidden variable is passed to the perl script. Here is the code
I'm using:
#!/usr/local/bin/perl
# GOTOURL
# Ver. 1.0
# By T. Amur
# Internet: http://www.crossworld.com/
# Email: ta@crossworld.com
# Released 11-23-98
# Updated 11-23-98
#
# Copyright (C) 1998 Crossworld Communications
#
# Form data example:
#
# <form method="post"
action="http://www.crossworld.com/cgibin/gotourl.cgi">
# <select name="goto" size="1">
# <option value="www.crossworld.com">Crossworld</option>
# <option value="www.truckshow.com">ITS</option>
# </select>
# <input type="submit" value="GO!">
# </form>
#
# $main - default page if there is no
# url specified when the script is executed
#
#------- Configuration ----------------------------
$main = 'http://www.crossworld.com/';
#--- Configuration --------------------------------
&FormData(*input);
if($input{'goto'} eq "")
{
# print "HTTP/1.0 302 Temporary Redirection\r\n" if $ENV{PERLXS}
eq "PerlIS";
# print "Content-type: text/html\n";
# print ("Location: $main\n\n");
exit;
}
else
{
if ($input{'goto'} !~ m?://?)
{
$input{'goto'} = "http://" . $input{'goto'};
}
print "HTTP/1.0 302 Temporary Redirection\r\n" if $ENV{PERLXS}
eq "PerlIS";
print "Content-type: text/html\n";
print ("Location: $input{'goto'}\n\n");
}
exit;
#----------------------
# FormData: Function
#----------------------
sub FormData
{
local (*qs) = @_ if @_;
if ($ENV{'REQUEST_METHOD'} eq "GET")
{
$qs = $ENV{'QUERY_STRING'};
}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{
read(STDIN,$qs,$ENV{'CONTENT_LENGTH'});
}
@qs = split(/&/,$qs);
foreach $i (0 .. $#qs)
{
$qs[$i] =~ s/\+/ /g;
$qs[$i] =~ s/%(..)/pack("c",hex($1))/ge;
($name,$value) = split(/=/,$qs[$i],2);
if($qs{$name} ne "")
{
$qs{$name} = "$qs{$name}:$value";
}
else
{
$qs{$name} = $value;
}
}
return 1;
}
------------------------------
Date: 22 Dec 1998 17:30:40 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Script To return 'do nothing'
Message-Id: <75ol00$k95$4@news0-alterdial.uu.net>
Nick Vega <nickvega@hotmail.com> wrote:
> I'm using a perl script to redirect (drop down menu) to another URL
> from an HTML page via action post. What I want to do is to have the
> script return a 'do nothing' command to the browser when no URL or
> some hidden variable is passed to the perl script. Here is the code
> I'm using:
The official way is to return an HTTP status code of 204, which tells
the browser to do exactly what you want: nothing. I am told that
Internet Explorer, another fine Microsoft product, fails to implement
this correctly, though, which might be a concern for you (if you have to
support brain-damaged but popular browsers).
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Tue, 22 Dec 1998 19:18:28 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Script To return 'do nothing'
Message-Id: <Pine.HPP.3.95a.981222190523.14328N-100000@hpplus01.cern.ch>
On 22 Dec 1998, Greg Ward wrote:
> Nick Vega <nickvega@hotmail.com> wrote:
> > I'm using a perl script to redirect (drop down menu) to another URL
> > from an HTML page via action post. What I want to do is to have the
> > script return a 'do nothing' command to the browser when no URL or
> > some hidden variable is passed to the perl script.
That all sounds a bit awkward to me, and potentially confusing to
readers. It's also not a perl language question - the nearest
appropriate group would be comp.infosystems.www.authoring.cgi, where,
not surprisingly, you'd find a good answer waiting for you in Nick Kew's
CGI FAQ.
> The official way is to return an HTTP status code of 204, which tells
> the browser to do exactly what you want: nothing.
Indeed.
> I am told that
> Internet Explorer, another fine Microsoft product, fails to implement
> this correctly,
Earlier versions did indeed get that wrong, but after I had put up a
web page tabulating status-204 problems with that and other older
browsers, I had a nice email from somebody at MS asking me to confirm
that it had been fixed in NS4 beta (as it was at that time), and I was
happy to confirm that it had. You can also make it work, if you're
careful, in a number of variations of MSIE3, as my web page (cited in
the FAQ) shows.
> though, which might be a concern for you (if you have to
> support brain-damaged but popular browsers).
On the WWW, don't we all?
cheers
------------------------------
Date: Tue, 22 Dec 1998 16:03:11 +0000
From: Ryan <see@bottom.of.sig>
Subject: Searching for wildcard characters
Message-Id: <367FC2BF.BE3CD0B5@bottom.of.sig>
simple question..
how can i search for the * character ?
you can see below that it will just return all accounts locked.
while (<PWD>)
{
($fname, $encrypted, $uid, $gid, $cos, $home, $shell) = split ( /:/);
if ($encrypted eq "*") # Check if the account is Locked
{
thx in advance
--
manics@rocketmail.nospam.com
------------------------------
Date: 22 Dec 1998 08:44:48 -1200
From: Jeremy Bowen <JeremyB@clear.net.nz>
Subject: Re: Sendmail
Message-Id: <jeremyblnjzq533.fsf@clear.net.nz>
"John Talbert" <*johntalbert@home.com*> writes:
First, find the bit in you news program that posts messages in MIME
format and turn it OFF!!
To answer your question, I used to run a version of sendmail that came
with the Lyris mailing list server. From memory this is available at
http://www.lyris.com/
You could give it a try.
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_001A_01BE2C8C.DBF89EA0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
>
> I am looking for a Win95/98 program compatable with SENDMAIL ( =
> http://www.sendmail.org ). I am using the latest version of Perl =
> (downloaded it last night) and Apache 1.3.3 on a Win32 machine running =
> Windows 95. Can anyone help?
>
> ------=_NextPart_000_001A_01BE2C8C.DBF89FA0
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
--
/-------------------------------------------------------------\ o@C>-
| Jeremy Bowen JeremyB@clear.net.nz | __/___
| "It's a question of intelligence -- so your opinion has | {_XX_(_@=
| very little relevance" . . . Avon Blake's 7 | o@C>-
\-------------------------------------------------------------/ o@C>-
------------------------------
Date: Tue, 22 Dec 1998 12:02:15 -0500
From: Sean Hussey <sean@youknowwhattoremove.weblabs.com>
Subject: sizeof() function?
Message-Id: <367FD096.A46DC62@youknowwhattoremove.weblabs.com>
Hi everyone,
I must be going crazy here. I could have sworn there was a sizeof()
function (or something like it) in Perl. Am I just confusing it with C
and JavaScript? Is there something in Perl that will do something like
sizeof() in these other languages?
Thanks for your help,
Sean
------------------------------
Date: 22 Dec 1998 17:27:09 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: sizeof() function?
Message-Id: <75okpd$k95$3@news0-alterdial.uu.net>
Sean Hussey <sean@youknowwhattoremove.weblabs.com> wrote:
> I must be going crazy here. I could have sworn there was a sizeof()
> function (or something like it) in Perl. Am I just confusing it with C
> and JavaScript? Is there something in Perl that will do something like
> sizeof() in these other languages?
No, there isn't. Perl provides a level of abstraction well away from
bit-twiddling. Of course, it also lets you twiddle bits with
pack/unpack/vec and the like, in which case it could be useful to know
the size of *C* types (int, struct foo, etc.) -- but to get that, you'll
have to write C code.
You might want to explain *why* you want sizeof, and someone can help
you with an alternate solution.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Tue, 22 Dec 1998 13:12:00 -0500
From: tabo <cswfrank@rica.net>
Subject: sorting
Message-Id: <367FE0F0.FA9AB3BB@rica.net>
this is a little blurb that i wrote to try out the sort()
open (WORDLIST, "+< x33b.txt") || die "cant open $filename: $!";
while (defined ( $list = <WORDLIST>)) {
chomp ($list);
@lists = <WORDLIST>
}
close(WORDLIST);
$writefile = "temp2.txt";
open (WRITE, "> $writefile") || die "cant open $writefile:$!";
print "$lists[0]\n";
print "$lists[1]\n";
@articles = sort {uc($a) cmp uc($b)} @lists;
$items = $#articles;
print "$items\n";
for ($i =0;$i<$items;$i=$i+1) {
print WRITE"$articles[$i]";
}
close (WRITE);
it works fine for the most part. this is the output files contents
$start.htm
cmdhtm.zip
cmdref.pdf
cmdwp5.zip
cmdwp6.zip
install.htm
install.pdf
insthtm.zip
instwp5.zip
instwp6.zip
mprntgde.htmmprntgde.pdf <- this is the only instanc, but it i change
the name of either one, another occurs with another file name
mprnthtm.zip
mprntwp5.zip
mprntwp6.zip
msghtm.zip
msgref.pdf
msguide.htm
msguide.pdf
msguihtm.zip
msguiwp5.zip
msguiwp6.zip
msgwp5.zip
msgwp6.zip
rlsgde.pdf
rlshtm.zip
rlswp5.zip
rlswp6.zip
usergde.pdf
userhtm.zip
userwp5.zip
userwp6.zip
x33htm.zip
x33pdf.zip
x33wp5.zip
can anyone explain why there are two entries on one line? while other
files with the same name but different extension are not affected.
--
Ezekiel 25:17
"The path of the righteous man is beset on all sides by the inequities
of the selfish and the tyranny of evil men. Blessed is he, who in the
name of charity and good will, shepherds the weak through the valley of
darkness, for he is truly his brother's keeper and the finder of lost
children. And I will strike down upon thee with great vengence and
furious anger those who attempt to poison and destroy my brothers. And
you will know my name is the Lord when I lay my vengence upon thee."
-Jules, Pulp Fiction
------------------------------
Date: Tue, 22 Dec 1998 10:52:40 -0500
From: "Ken Hirsch" <kenhirsch@myself.com>
Subject: Re: Turning Variables into CAPS?
Message-Id: <75of42$o0i$1@fddinewz.oit.unc.edu>
Tk Soh wrote in message:
[...]
>ucfirst() only converts the first letter of the string. any function
>that converts first letter of each word to uppercase, etc?
>
>I always find the case conversion function in the word processor
>something useful.
Well, you could:
s/\b(\w)/uc $1/eg;
But The Question Is "Do You Want To Do This"?
Ken Hirsch
------------------------------
Date: Tue, 22 Dec 1998 11:44:52 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Why does my browser try to download the script instead of execute it?
Message-Id: <367FCC82.A5F0568A@cthulhu.demon.nl>
Worldmall wrote:
>
> Do you know why my browser tries to download the cgi/pl scripts I installed
> instead of executing them? I changed the chmod to 755 and I even tried 777 but
> it still tried to download the scripts :(
>
> Could this mean the administrators have disabled cgi scripts from running in
> any directory other than cgi-bin? They say they've enabled execute for all
> subdirectories as I requested but I just don't see it.
> Where should I start so I can make these scripts run properly?
Seems the webserver is not configured properly to execute your script.
So bug the administrators about it :)
Erik
------------------------------
Date: Tue, 22 Dec 1998 13:04:52 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why does my browser try to download the script instead of execute it?
Message-Id: <comdog-ya02408000R2212981304520001@news.panix.com>
In article <367FCC82.A5F0568A@cthulhu.demon.nl>, newsposter@cthulhu.demon.nl posted:
> Worldmall wrote:
> >
> > Do you know why my browser tries to download the cgi/pl scripts I installed
> > instead of executing them? I changed the chmod to 755 and I even tried 777 but
> > it still tried to download the scripts :(
> Seems the webserver is not configured properly to execute your script.
> So bug the administrators about it :)
or that it is configured properly and the poster just doesn't know
where to set up his cgi script or how to name it ;)
of course, this has nothing to do with Perl.
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4480
**************************************