[13859] in Perl-Users-Digest
Perl-Users Digest, Issue: 1269 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 3 18:05:57 1999
Date: Wed, 3 Nov 1999 15:05:20 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941670319-v9-i1269@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 3 Nov 1999 Volume: 9 Number: 1269
Today's topics:
$0 (PROGRAM_NAME) <usteimx@lexis-nexis.com>
Re: -w (brian d foy)
Re: and since you seem to know your way about... (Kragen Sitaker)
Re: and since you seem to know your way about... (Bill Moseley)
Re: and since you seem to know your way about... <gellyfish@gellyfish.com>
Re: Another 'or'? was [perl double-split] (Bart Lateur)
Re: core dump - perl, me or server? kent@darwin.eeb.uconn.edu
Re: Determining Open Mode <rootbeer@redcat.com>
Re: Dos box when running perl CGIs paul_rahe@cissc.canon.com
Re: Extracting just the date from a string (Abigail)
Help for listing directory contents <zomzomNOzoSPAM@hotmail.com.invalid>
Re: Help for listing directory contents <rootbeer@redcat.com>
Re: Help Needed in Win32::API (Jan Dubois)
HELP! eval("\$val = \$this") != ($val=$this) ?????Perl <dani@3dsite.com>
HELP:Elements in an array have a space in front of them <ehberry@uswest.com>
Re: HELP:Elements in an array have a space in front of (Kragen Sitaker)
Re: HELP:Elements in an array have a space in front of <ltl@rgsun5.viasystems.com>
Re: HELP:Elements in an array have a space in front of <rootbeer@redcat.com>
Hex output help nite_eagle@hotmail.com
Re: Hex output help (Alan Curry)
Re: Hiding Perl Scripts? (Tad McClellan)
How can I determine amount of free space. <george.l.kittrell@boeing.com>
Re: Limit of Win32::GetTickCount <schoedema@my-deja.com>
Re: Limit of Win32::GetTickCount (Jan Dubois)
Re: Limit of Win32::GetTickCount <camerond@mail.uca.edu>
Re: module proposal for WML <ken@bitsko.slc.ut.us>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 03 Nov 1999 15:16:05 -0500
From: Mark Steiger <usteimx@lexis-nexis.com>
Subject: $0 (PROGRAM_NAME)
Message-Id: <38209805.6C17D186@lexis-nexis.com>
I'm currently trying to use $0 to get the program name in a perl script
under windows NT. Unfortunately it returns a truncated 8 character dos
equivilent, i.e. progra~1.pl. Is there a way to get the full file name
under WinNT ?
------------------------------
Date: Wed, 03 Nov 1999 15:21:18 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: -w
Message-Id: <brian-0311991521180001@123.new-york-73-74rs.ny.dial-access.att.net>
In article <7vq48q$d6l$2@info2.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <MPG.1287a5dc7c6f70af98a171@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> writes:
>
>: Ahem. The legal drinking age is now 21, everywhere in the USA, as far
>: as I know. Don't give the (still a) minor any bad ideas, or any alcohol
>: for that matter.
>
>Anyone who may legally possess firearms and anyone who might be
>compelled to go fight a war certainly deserves the occasional beer or
>seven. Don't you know that half (nay, three-quarters) of the fun of
>Perl people gatherings is getting sloshed together? :-)
the other quarter is obviously using firearms:
http://sussex.pm.org/campcamel/index.html
a shotgun does quite a bit of damage to a Selena Sol book. :)
--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
<URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 03 Nov 1999 20:54:02 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: and since you seem to know your way about...
Message-Id: <Kh1U3.25376$23.1310734@typ11.nn.bcandid.com>
In article <38207871.75F333EC@hotmail.com>,
Re'em Bar <reembar@hotmail.com> wrote:
>I want my program to create a new file on the server and then read/write
>it. should it be a problem on Unix/Linux because of the permission
>business? is it simpler on NT?
No. But you need to decide who owns the file; the default should be
fine if you don't share the server with anyone else, or if you trust
everyone you share the server with. otherwise the default may not be
fine.
>also,
>I am doing miniature web-search engine, and want to read files from the
>net to make an index. but the lines:
>
>open(FILE,"http://www.snark.co.il/index.shtml");
>@html=<FILE>;
>close(FILE);
>
>don't seem to do the trick.
>have I done wrong?
Use LWP.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Wed, 3 Nov 1999 12:55:22 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: and since you seem to know your way about...
Message-Id: <MPG.128a41196b27c30798983f@nntp1.ba.best.com>
Re'em Bar (reembar@hotmail.com) seems to say...
> open(FILE,"http://www.snark.co.il/index.shtml");
> @html=<FILE>;
> close(FILE);
chmod 0755, 'http://www.snark.co.il/index.shtml';
doesn't work either!
maybe opendir(DIR, 'http://www.snark.co.il/') or die $!;
Nope?!?!
That would be nice if that worked that way. But it doesn't.
perldoc LWP
perldoc LWPCook
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 3 Nov 1999 22:13:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: and since you seem to know your way about...
Message-Id: <7vqc20$6bj$1@gellyfish.btinternet.com>
On Wed, 03 Nov 1999 20:01:21 +0200 Re'em Bar wrote:
> I am doing miniature web-search engine, and want to read files from the
> net to make an index. but the lines:
>
> open(FILE,"http://www.snark.co.il/index.shtml");
You cant do that a URL is not a file description - you can retrieve a
resource via a URL by use the module LWP::Simple part of libwww-perl
which can be found at CPAN <http://www.cpan.org> (or via PPM if you
are using Activeperl).
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Wed, 03 Nov 1999 21:04:31 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Another 'or'? was [perl double-split]
Message-Id: <38209b21.538374@news.skynet.be>
Bernie Cosell wrote:
>I actually agree, in part, with a remark that someone else made: Perl would
>then have *four* 'or' operators [| || or ??] and all of a sudden you'll
>have new [and *much* more subtle, IMO] bugs with folk picking the wrong
>ones.
I'm not sure. Actually, I suspect that most current uses of || actually
are intended to behave as "??" would. "My strings will never be empty",
and "my strings will never be '0'" is an assumption that is made far too
often. So it could well be that "??" would become the most often used
"or".
If people pick the wrong one, we're not worse off than we are now,
without "??".
--
Bart.
------------------------------
Date: 03 Nov 1999 16:46:02 -0500
From: kent@darwin.eeb.uconn.edu
Subject: Re: core dump - perl, me or server?
Message-Id: <wkiu3jgsf9.fsf@darwin.eeb.uconn.edu>
I'm running Perl 5.005_02 built for sun4-solaris under Solaris 2.6 and
do not see the problem.
Kent
--
Kent E. Holsinger Kent@Darwin.EEB.UConn.Edu
http://darwin.eeb.uconn.edu
-- Department of Ecology & Evolutionary Biology
-- University of Connecticut, U-43
-- Storrs, CT 06269-3043
------------------------------
Date: Wed, 3 Nov 1999 14:27:21 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Determining Open Mode
Message-Id: <Pine.GSO.4.10.9911031424470.29670-100000@user2.teleport.com>
On Wed, 3 Nov 1999, Jim Williams wrote:
> I'm creating a module that represents a particular file format we use.
> Such objects can be configured to either read or write the format, but
> not both.
Well, if by "objects" you mean "objects" (in the Computer Science sense),
you could probably store the r/w state as an extra field. No?
BTW, why not both? Maybe that's the solution.
> The constructor accepts a filehandle, so I have to add another
> argument, 'r' or 'w', so I know if the object is being created for
> input or output.
Well, you can have the constructor create the filehandle. Of course,
you're told in that case what mode to use. You could do it in the way that
the new three-argument open() does it.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 03 Nov 1999 20:39:03 GMT
From: paul_rahe@cissc.canon.com
Subject: Re: Dos box when running perl CGIs
Message-Id: <38209c67.69302601@news.cis.canon.com>
On Wed, 03 Nov 1999 17:24:32 GMT, semiel@usa.net wrote:
>When running a perl cgi script in a browser (on the PC where perl is
>installed of course) there is a very brief dos box opening when running
>perl.exe.
The interpreter does not need to be installed in the client for this
task, it needs to be running on the web server.
>
>The script works alright but i just wanted to know if there was a way
>to prevent a dos box from opening?
Are you running a web server on your client PC? It sounds like you
may have a web server configuration issue.
You might want to try asking this question in
comp.infosystems.www.authoring.cgi.
>
>Thanks for your help,
>Alain.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: 3 Nov 1999 16:22:10 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Extracting just the date from a string
Message-Id: <slrn821djk.dk.abigail@alexandra.delanet.com>
Peter J. Kernan (pete@theory2.phys.cwru.edu) wrote on MMCCLV September
MCMXCIII in <URL:news:slrn820r6l.6uc.pete@theory2.phys.cwru.edu>:
\\ On Tue, 2 Nov 1999 08:48:48 -0800, Larry Rosler <lr@hpl.hp.com> wrote:
\\ .=Oh, come on. This is such nonsense. Here's all it takes, and that can
\\ .=be explained in very few words:
\\ .=
\\ .= $_ = 'From xyzacc@abc.com Mon Aug 30 17:16:24 1999';
\\ ^extra space removed here
\\ .=
\\ .= my ($date) = / (.*)/;
\\ .=
\\ you may have to just a wee bit more precise in case
\\
\\ From xyzacc@abc.com Mon Aug 2 17:16:24 1999
\\ ^^
\\ is a possible data point. also (on my system at least) sometimes i have
\\ 2 spaces before the weekday, sometimes 1. perhaps the specification is
\\ mistaken, perhaps not. to be slightly more careful and trying to remain
\\ brief i would
Why? The 2 spaces after the address are given, so those will match.
If there are 2 spaces later on, that will all be gobbled up by the .*.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 03 Nov 1999 13:36:56 -0800
From: ScrO <zomzomNOzoSPAM@hotmail.com.invalid>
Subject: Help for listing directory contents
Message-Id: <11f733ec.44ac7be2@usw-ex0102-010.remarq.com>
I am looking for a script that will dynamically list the contents of a
directory (the dir that I'm in) and insert them into a Web page when it
is served up. Not recursively, just the contents of the current
directory (files and subdirectories).
Keep in mind, this is only part of the content of the page, I can't
just turn directory browsing on. (=
I am sure this is an easy script, but I can't seem to figure it out.
Any help would be greatly appreciated.
Thanks,
Adam
alyon@vitria.com
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 3 Nov 1999 14:59:23 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help for listing directory contents
Message-Id: <Pine.GSO.4.10.9911031458450.29670-100000@user2.teleport.com>
On Wed, 3 Nov 1999, ScrO wrote:
> I am looking for a script
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service.
If you want to write one, look for readdir and friends in the perlfunc
manpage.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 03 Nov 1999 21:51:21 +0100
From: jand@activestate.com (Jan Dubois)
Subject: Re: Help Needed in Win32::API
Message-Id: <38229c87.3375083@news3.ibm.net>
[mailed & posted]
Ismail Mohideen <Ismail_Mohideen@amsinc.com> wrote:
>The code looks like this
>
>#This is the function to be called
>#FUNCTION long RSSetMRTName(REF string nme, boolean so)
>
>$setMRT = new Win32::API("D:/Program Files/Microsoft Visual
>Studio/MyProjects/mrtdll/Debug/mrtdll","RSSetMRTName",[P,N],N);
>$fileloc = "d:/perl/bin/AL000001.dat";
>$ret = $setMRT->call($fileloc,0);
>
>I tried debugging, looks like it goes into the loop in the AUTOLOAD
>subroutine in the module.
I believe the method name is 'Call' and not 'call'
-Jan
------------------------------
Date: Wed, 03 Nov 1999 13:55:01 -0800
From: Daniele Colajacomo <dani@3dsite.com>
Subject: HELP! eval("\$val = \$this") != ($val=$this) ?????Perl BUG?
Message-Id: <3820AF35.843F619F@3dsite.com>
(there's a CLUE at the end of this message!)
I've already posted a message asking for help, but here's a clearer,
and more puzzling eval behavior:
I have an object called $this
the following lines, one after another:
eval("\$trace3 = \$this");
$trace4 = $this;
yeld two different results. That is, I would think that
$trace3 and $trace4 are the same, but instead they appear
to be two different objects (both valid, and of all )!!
How is it possible for eval to act in a different content?
I've tracked it further to a very mindboggling situation.
Going back to the top of this particular process, there's another eval:
eval("sub _us_code_$::V{US_CODE_COUNTER}(\$) { my (\$this) = \@_; $val
};");
eval("\@val = _us_code_$::V{US_CODE_COUNTER}(\$this)");
the $val which makes up the _us_code_* function is:
"my $f = new_object("custom:faq/faq","faq"); $f->cset();"
Now I've tracked it down with the debugger, and where it all starts
getting confused is when $f->cset() is called.
$f is the object I'd expect it to be, but once it gets inside
cset() it changes and becomes a different object! That is it becomes
the $this of the top-most eval.
cset is:
sub cset($) {
my ($this) = @_;
if (!$this->configuration_is_loaded()) { # load default
configuration
$this->configuration_load($this->get("name"));
}
}
Then within the function at the top of this message, the object that is
passed as $this is the wrong one, BUT when it is assigned to $trace4
is the right one, and the eval'd is the wrong one - I'm really lost.
CLUE TO IT ALL (for those of you who can figure it out):
if I change $this to another name in cset, ie:
sub cset($) {
my($o) = @_;
....
}
then the $o object is the correct one!!!!!!!!!!!!!
There seems to be some namespace confusion going on, and for the life
of me I cannot figure it out (of course I could change all the $this to
something else for the functions called by the top-most eval, but
that's like leaving a time-bomb alone by stepping sideways for the
moment...).
Anyone who's able to help please let me know what you think!
thanks!
dani
------------------------------
Date: Wed, 03 Nov 1999 14:00:09 -0700
From: Ed Berry <ehberry@uswest.com>
Subject: HELP:Elements in an array have a space in front of them
Message-Id: <3820A259.4B8903C9@uswest.com>
I am comparing 2 arrays and creating a third array. The array I am
creating puts a space in the first character of each element except for
the first one. Here is the code:
# Compare each city name to weather city names from web
foreach $city_name (@city_dat) {
foreach $weather_name (@city_weather) {
$found = 0;
next if (substr($weather_name,0,14) ne $city_name);
push(@weather,$weather_name);
$found = 1;
last;
}
if (!$found) {
push(@not_found,$city_name);
}
}
The array @weather looks like this:
ALBUQUERQUE NM 50 27 41 0 at 3 30.33 1024.0 10 250 SCT
BOISE ID 46 27 47 0 at 0 30.22 1024.2 10
CLR
BREMERTON WA 45 37 76 200 at 6 30.02 1000.0 10 90
BKN
BROOMFIELD CO 59 18 20 160 at 10 30.20 1000.0 60 200
SCT
The first element is correct but all the following elements have a space
in the first character. What am I doing wrong?
Ed Berry
-What if The Hokey Pokey IS what it's all about?
Phone: 303-784-1147
Pager: 888-520-1026
Email: ehberry@uswest.com
------------------------------
Date: Wed, 03 Nov 1999 21:58:38 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: HELP:Elements in an array have a space in front of them
Message-Id: <ie2U3.25502$23.1324006@typ11.nn.bcandid.com>
In article <3820A259.4B8903C9@uswest.com>,
Ed Berry <ehberry@uswest.com> wrote:
>The array @weather looks like this:
>
>ALBUQUERQUE NM 50 27 41 0 at 3 30.33 1024.0 10 250 SCT
> BOISE ID 46 27 47 0 at 0 30.22 1024.2 10
>CLR
> BREMERTON WA 45 37 76 200 at 6 30.02 1000.0 10 90
>BKN
> BROOMFIELD CO 59 18 20 160 at 10 30.20 1000.0 60 200
>SCT
>
>The first element is correct but all the following elements have a space
>in the first character. What am I doing wrong?
My guess: you're doing print "@weather", which prints array elements
separated by spaces. The spaces aren't really in the array elements,
but are inserted by interpolating the array into a string.
But hey, I could be wrong.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 3 Nov 1999 22:08:24 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: HELP:Elements in an array have a space in front of them
Message-Id: <7vqboo$7o$1@rguxd.viasystems.com>
Ed Berry <ehberry@uswest.com> wrote:
:>I am comparing 2 arrays and creating a third array. The array I am
:>creating puts a space in the first character of each element except for
:>the first one. Here is the code:
Where is the code that adds a space? I think the problem is
in @city_weather and not in the code you show below.
:># Compare each city name to weather city names from web
:>foreach $city_name (@city_dat) {
:> foreach $weather_name (@city_weather) {
:> $found = 0;
:> next if (substr($weather_name,0,14) ne $city_name);
:> push(@weather,$weather_name);
:> $found = 1;
:> last;
:> }
:> if (!$found) {
:> push(@not_found,$city_name);
:> }
:>}
:>The array @weather looks like this:
:>ALBUQUERQUE NM 50 27 41 0 at 3 30.33 1024.0 10 250 SCT
:> BOISE ID 46 27 47 0 at 0 30.22 1024.2 10
:>CLR
:> BREMERTON WA 45 37 76 200 at 6 30.02 1000.0 10 90
:>BKN
:> BROOMFIELD CO 59 18 20 160 at 10 30.20 1000.0 60 200
:>SCT
:>The first element is correct but all the following elements have a space
:>in the first character. What am I doing wrong?
When faced with similar situations where the data doesn't look like
I expect, I've found using the perl debugger to be quite helpful.
perl -d yourscriptname and the args your script takes
> b some_line_number #put a breakpoint at a line in your program
> c # C for continue, run program until breakpoint
> x @city_weather #pretty prints the contents of this var
`perldoc perldebug` is entirely too verbose for what you need to know
to use the debugger to figure out a problem like this, so if you type
the char 'h' after entering the debugger you get a short summary that
should be enough to guide you if you have ever used any kind of
debugger before. If you have not used a debugger before...
Is there a perl debugger tutorial somewhere? It would be nice to be
able to point people at one. I suffered through sdb in my early
years and so did not need a tutorial to learn the perl debugger and
have never looked for one.
You could also use the technique where you sprinkle print statements
in your program, but I only do that if getting to the debugger is
hard.
:>Ed Berry
:>-What if The Hokey Pokey IS what it's all about?
If we get just a little bit of luck we could be doing the
pokey in the national championship game. Go Hokies!
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Wed, 3 Nov 1999 14:35:04 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: HELP:Elements in an array have a space in front of them
Message-Id: <Pine.GSO.4.10.9911031433010.29670-100000@user2.teleport.com>
On Wed, 3 Nov 1999, Ed Berry wrote:
> The first element is correct but all the following elements have a space
> in the first character. What am I doing wrong?
Look at your print statement. You didn't include it in your message, and I
couldn't read it with the Usenet::ESP module. Do you have double quote
marks around an array whose elements contain newline characters?
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 03 Nov 1999 20:10:53 GMT
From: nite_eagle@hotmail.com
Subject: Hex output help
Message-Id: <7vq4s9$bv4$1@nnrp1.deja.com>
I am using DBI to get some data.
The data is a MSSQL timestamp (binary) column.
The microsoft tools display the data as 0x0000000100018606
The data as displayed as smilie faces, music notes, spades etc
I tried printf "0x%x" , $data; but that just output 0x0
How do I get perl to output what DBI gave me as a hex string?
Thanks,
Norman
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 03 Nov 1999 20:34:59 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Hex output help
Message-Id: <T%0U3.25359$23.1312832@typ11.nn.bcandid.com>
In article <7vq4s9$bv4$1@nnrp1.deja.com>, <nite_eagle@hotmail.com> wrote:
>I tried printf "0x%x" , $data; but that just output 0x0
>How do I get perl to output what DBI gave me as a hex string?
for (split //, $yourvar) {
printf "%02x", ord $_;
}
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Wed, 3 Nov 1999 09:37:02 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Hiding Perl Scripts?
Message-Id: <eahpv7.26a.ln@magna.metronet.com>
LorainCounty.com Webmaster (webmaster@LorainCounty.com) wrote:
: How could I hide the source code of a Perl Script so
: it can't be modified or viewed? I might have to place the script on a
: server I have no control over but would like to keep the Perl Script
: intact.
What does "intact" mean there?
Are you worried that someone will be able to modify your program?
That should not be possible on a correctly configured server.
: I have read the FAQ (3 & 8) about compiling the code but as I read
: them
: that didn't seem to be the answer.
That _is_ the answer.
The answer is that it cannot be done.
You may not like the answer, but it is an answer nonetheless.
Put a license on your code.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 3 Nov 1999 21:23:43 GMT
From: George Kittrell <george.l.kittrell@boeing.com>
Subject: How can I determine amount of free space.
Message-Id: <3820A7DF.5C0AA721@boeing.com>
Does anyone know how I can determine the amount of free space on a given
drive using perl.
I am using Active Perl on an NT workstation.
Thanks for any help;
George Kittrell
george.l.kittrell@boeing.com
------------------------------
Date: Wed, 03 Nov 1999 20:15:25 GMT
From: Peach <schoedema@my-deja.com>
Subject: Re: Limit of Win32::GetTickCount
Message-Id: <7vq54o$c2t$1@nnrp1.deja.com>
In article <3820683B.31D40917@mail.uca.edu>,
Cameron Dorey <camerond@mail.uca.edu> wrote:
> Honestly, I think that there are going to be some/most/all readers
here
> that are amazed that you could keep a Window$ system running
> continuously for 50 days. But that's another matter. ;)
>
> Cameron
The System is a dedicated Oracle 8.1.5 Server Machine running under
Windows NT4.0 (Compaq Pro Liant) and has now a uptime over 100 days!
(I'm not kidding) (-:
And there are a lot of perl programs connecting to the database with
the DBI::Oracle module.
Peter
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 03 Nov 1999 21:51:23 +0100
From: jand@activestate.com (Jan Dubois)
Subject: Re: Limit of Win32::GetTickCount
Message-Id: <38249f47.4079235@news3.ibm.net>
[mailed & posted]
Peach <schoedema@my-deja.com> wrote:
>Hi all,
>I've been written a little perl program to calculate the uptime of my
>system using the function Win32::GetTickCount, which returns the
>elapsed time in milliseconds since the last system boot time.
>The script is working fine until an uptime of approximately 50 days.
>Then the counter is reseted to zero.
>Does anyone know a workaround of this problem?
You can use the NT performance counters (via Win32::PerfLib). A sample
program that does exactly this can be found here:
http://www.bybyte.de/jmk/showsource.asp?f=data/scripts/SystemUpTime.pl
-Jan
------------------------------
Date: Wed, 03 Nov 1999 15:36:04 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Limit of Win32::GetTickCount
Message-Id: <3820AAC4.459037CF@mail.uca.edu>
Kragen Sitaker wrote:
>
> In article <3820683B.31D40917@mail.uca.edu>,
> Cameron Dorey <camerond@mail.uca.edu> wrote:
> >Well, you could go to a 64-bit Window$ system...
>
> Are there any? I thought even NT for Alpha was 32-bit.
Well, actually, no, but M$ promised one was coming back in 1996. ;)
http://www.microsoft.com/PressPass/press/1996/jun96/nt64btpr.htm
>
> >50 days = 4,320,000,000 msec
> >2^32-1 = 4,294,967,295
> >2^64-1 = 1.844674407...*10^19
> >
> >You might also want to use Math::BigInt
>
> Won't help, I don't think.
You're right. The problem isn't in the math, but the tick counter
overloads at 2^32-1 counts. I really didn't think it would work, but I
hadn't played around with things when I wrote that.
Funny thing, though, using Peter's little script and adding a final
line:
print "uptime = $uptime";
on a Win 98 box which has been up about 3-1/2 days, I get
The System has been up for 3 days 13 hours
34 minutes 7 seconds
uptime = 264847
but on a WinNT box which has been up about 10 days, I get
The System has been up for 10 days 11 hours
38 minutes 30 seconds
uptime = -1257750
Why the negative sign here (and as time passes the number gets less
negative), I don't know. Must be something funny with NT...
>
> >Honestly, I think that there are going to be some/most/all readers here
> >that are amazed that you could keep a Window$ system running
> >continuously for 50 days. But that's another matter. ;)
>
> I'm not amazed -- my Windows NT box at work is as stable as my
> Solaris2.4 system at a previous job was. (Neither approaches the
> stability of my Linux system, but that's another matter.)
Well, now we need a longevity contest, but not in this forum, I guess.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Wed, 03 Nov 1999 20:49:11 GMT
From: Ken MacLeod <ken@bitsko.slc.ut.us>
Subject: Re: module proposal for WML
Message-Id: <m3u2n3qpct.fsf@biff.bitsko.slc.ut.us>
sgrantz@visi.com (Steve Grantz) writes:
> WML (wireless markup language) is a valid XML subset developed by
> the WAP (wireless application protocol) Forum,
> http://www.wapforum.org . I am building a library of functions to
> be accessed as virtual methods that will produce valid WML text
> through the use of named paramter attributes.
>
> While I realize B. Holzman's XML::Generator module would do an
> excellent job of this, by building a specific subset of functions I
> hope to create a library that enforces the WML standards as
> developed by the WAP Forum, and therefore gives a helping hand in
> validation. These would be similar to the CGI form functions of
> L. Stein's CGI.pm.
>
> I think an appropriate name might then be XML::WML.
>
> I would love to hear comments on this idea, especially its place in
> the namespace,
There is a rough consensus on the perl-xml mailing list that only
modules that deal generically with XML should go in the XML::*
namespace. Modules that deal with specific applications of XML should
go in a more descriptive top-level namespace. I don't know enough
about your module to suggest a more appropriate namespace, but it
sounds like it would fit in section 5 or 6 of the Perl module list.
> the extent to which the functions should enforce valid WML
> standards, and other areas.
The extent is probably ``as much as you can'' given the complexity and
how much time you have.
For implementation, you might want to see if using SAX would feasible.
SAX would allow you to seperate the validation function from the WML
reading and writing functions. SAX could also make it easier to work
with other XML modules that also use SAX, such as
XML::Handler::XMLWriter or XML::Checker. SAX documentation and
examples are in libxml-perl in the XML module directory on CPAN.
You can email me or the Perl-XML mailing list for more details. You
can browse or subscribe to the Perl-XML mailing list at
<http://www.activestate.com/support/mailing_lists.htm#XML>
--
Ken MacLeod
ken@bitsko.slc.ut.us
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 1269
**************************************