[17722] in Perl-Users-Digest
Perl-Users Digest, Issue: 5142 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 18 18:06:11 2000
Date: Mon, 18 Dec 2000 15:05:19 -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: <977180719-v9-i5142@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 18 Dec 2000 Volume: 9 Number: 5142
Today's topics:
- Protecting a distributed CGI script... what are my op <vemba72@hotmail.com>
Re: - Protecting a distributed CGI script... what are m <crowj@aol.com>
.pl or .plx? <bcaligari@my-deja.com>
Re: .pl or .plx? (Logan Shaw)
Re: .pl or .plx? <chris.nospam.godaire@rcn.com>
Re: .pl or .plx? (Martien Verbruggen)
Apache Perl Problem? (Open File) <paul_wasilkoff@ucg.org>
Re: Apache Perl Problem? (Open File) <dwilgaREMOVE@mtholyoke.edu>
blocked threads <jamie@thale.nott.ac.uk>
Re: Can you help me? (Tad McClellan)
CGI script <lalit@engrs.unl.edu>
Configuring dmake for VC++ for Perl build ()
existing files <iLs@cyberdude.com>
Get epoch seconds range for today (nobody)
Re: Get epoch seconds range for today <zigouras@mail.med.upenn.edu>
Re: Get epoch seconds range for today <chris.nospam.godaire@rcn.com>
Re: Get epoch seconds range for today (Martien Verbruggen)
Re: Get epoch seconds range for today (Logan Shaw)
Hello World with Text::PDF raymond_ali@my-deja.com
help !! problem with perl's log function <coca88@hotmail.com>
Re: help !! problem with perl's log function (Ilya Zakharevich)
Re: help !! problem with perl's log function (Logan Shaw)
Help !!! <Please_reply@this.group>
Re: Hiding source <peter.sundstrom@eds.com>
Re: Hiding source (Martien Verbruggen)
How to secure HTTP form POST by a CGI <ryanmh_99@yahoo.com>
Re: Is Perl dying? <bcaligari@my-deja.com>
Re: Is Perl dying? (Logan Shaw)
Re: Language evolution C->Perl->C++->Java->Python (Is P <toriw@chello.no>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 18 Dec 2000 15:46:06 -0500
From: "Jon" <vemba72@hotmail.com>
Subject: - Protecting a distributed CGI script... what are my options?
Message-Id: <iIu%5.4051$1%4.144683@wagner.videotron.net>
I have a CGI script that was custom made for me which drives my website
engine (it's a template/raw file parser, voting booth, other small goodies,
etc.) and I myself am a website designer who would like to start building
sites using this file to drive them too (will make it easier for the client
too).
It would be sold cheap, because the design would be non-exclusive and
intended for the mass market. But my main concern is that someone will take
the code and start distributing it around... after all, there's nothing
easier to recycle than a CGI script.
One alternative I had in mind was rewriting the code in C and compiling it,
running it as an executable on the server. This would mean having to
personally compile each and every license sold to contain the client's
server path info. It's the only way I can think of to make sure the file
isn't recycled on 100 servers. It'll only work on one because the compiled
path info is embedded in it.
Another option was to leave the CGI as-is, but with 1 change : having it
seek out the server path info in a separate, C-compiled file. So I'd only
have to compile the path info (a 1-liner or two) and include it with the CGI
file. Of course, this means anyone with any working knowledge of CGI can
take the script and change the part where it seeks out the path info in a
separate file and enter it right into the CGI file itself, bringing us back
to point zero.
I know that there's really NO way, short of re-writing the code in C and
compiling it for each individual client, to really ensure the script will be
used for its intended purpose only... but I'd be happy with simply not
making it easy for people. The thing is, neither myself nor the original
author of the script know C.
Are there any alternate options for us we haven't considered? Perhaps using
somekind of cookie/hidden file technology?
------------------------------
Date: Mon, 18 Dec 2000 17:39:27 -0500
From: John Crowley <crowj@aol.com>
Subject: Re: - Protecting a distributed CGI script... what are my options?
Message-Id: <3A3E921F.431BE8C7@aol.com>
Jon wrote:
>
> I have a CGI script that was custom made for me which drives my website
> engine (it's a template/raw file parser, voting booth, other small goodies,
> etc.) and I myself am a website designer who would like to start building
> sites using this file to drive them too (will make it easier for the client
> too).
>
> It would be sold cheap, because the design would be non-exclusive and
> intended for the mass market. But my main concern is that someone will take
> the code and start distributing it around... after all, there's nothing
> easier to recycle than a CGI script.
>
> One alternative I had in mind was rewriting the code in C and compiling it,
> running it as an executable on the server. This would mean having to
> personally compile each and every license sold to contain the client's
> server path info. It's the only way I can think of to make sure the file
> isn't recycled on 100 servers. It'll only work on one because the compiled
> path info is embedded in it.
>
> Another option was to leave the CGI as-is, but with 1 change : having it
> seek out the server path info in a separate, C-compiled file. So I'd only
> have to compile the path info (a 1-liner or two) and include it with the CGI
> file. Of course, this means anyone with any working knowledge of CGI can
> take the script and change the part where it seeks out the path info in a
> separate file and enter it right into the CGI file itself, bringing us back
> to point zero.
>
> I know that there's really NO way, short of re-writing the code in C and
> compiling it for each individual client, to really ensure the script will be
> used for its intended purpose only... but I'd be happy with simply not
> making it easy for people. The thing is, neither myself nor the original
> author of the script know C.
>
> Are there any alternate options for us we haven't considered? Perhaps using
> somekind of cookie/hidden file technology?
This really has nothing to do with Perl.
Try comp.infosystems.www.authoring.cgi.
But yes, a compiled language is your only real option.
------------------------------
Date: Mon, 18 Dec 2000 19:19:50 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: .pl or .plx?
Message-Id: <91lo0f$5ci$1@nnrp1.deja.com>
Should standalone scripts be extensioned as .pl or as .plx?
I know that at the end of the day it doesn't make a difference, but
somewhere I must have read that *.plx is good practice for scripts
while *.pl should be left for perl libraries (what on earth is a perl
library??)
Anyways....vim doesn't automatically syntax highlight for .plx
(althouth easy to remedy) but I've downloaded ActiveState Komodo, which
(whilst lacking vi keystrokes) is quite nice. However I could not
figure out how to associate .plx with perl.
Brendon
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 18 Dec 2000 13:39:09 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: .pl or .plx?
Message-Id: <91lp4t$4eq$1@boomer.cs.utexas.edu>
In article <91lo0f$5ci$1@nnrp1.deja.com>,
Brendon Caligari <bcaligari@my-deja.com> wrote:
>Should standalone scripts be extensioned as .pl or as .plx?
Neither, in my opinion. That's what the #! at the beginning is for.
- Logan
------------------------------
Date: Mon, 18 Dec 2000 16:39:58 -0500
From: "Chris Godaire" <chris.nospam.godaire@rcn.com>
Subject: Re: .pl or .plx?
Message-Id: <91lvr7$5fp$1@autumn.news.rcn.net>
> Should standalone scripts be extensioned as .pl or as .plx?
It truly doesn't matter. I use .pl for everything, but can fully understand
why someone would use .plx. It's a matter of knowing what a file is at a
glance; something that's typically a bit easier in Windows than in a Unix
system.
> I know that at the end of the day it doesn't make a difference, but
> somewhere I must have read that *.plx is good practice for scripts
> while *.pl should be left for perl libraries (what on earth is a perl
> library??)
>
Perl libraries are like modules, but are loaded at run-time instead of
compile time. The line:
require 'file.pl';
would load the code inside of "file.pl", and you'd be able to call any of
the functions inside of it (provided it doesn't switch packages on you).
> Anyways....vim doesn't automatically syntax highlight for .plx
> (althouth easy to remedy) but I've downloaded ActiveState Komodo, which
> (whilst lacking vi keystrokes) is quite nice. However I could not
> figure out how to associate .plx with perl.
I'm assuming this is Windows of some sort... Open Windows Explorer, Click
View | Options | File Types.. You can add the .plx extension here
Chris Godaire
------------------------------
Date: Mon, 18 Dec 2000 22:09:43 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: .pl or .plx?
Message-Id: <slrn93t2l5.j5f.mgjv@verbruggen.comdyn.com.au>
On Mon, 18 Dec 2000 19:19:50 GMT,
Brendon Caligari <bcaligari@my-deja.com> wrote:
>
>
> Should standalone scripts be extensioned as .pl or as .plx?
Neither, or both. I normally don't care what the content of a script
is written in, so I tend to not give them any extensions (once they're
installed. In a source tree they may have extensions to facilitate
automatic make rules). Most people seem to use .pl, even though that
stands for perl library. With the advent of modules, and the slow
demise of libraries (almost no distinction), the problem is almost
non-existent.
It's just a file extension. The execution bits and/or first line of
the file are more important.
> I know that at the end of the day it doesn't make a difference, but
> somewhere I must have read that *.plx is good practice for scripts
> while *.pl should be left for perl libraries (what on earth is a perl
> library??)
A collection of subroutines, variables and constants for inclusion in
your programs. Nowadays these things are called modules (and are
slightly different).
> Anyways....vim doesn't automatically syntax highlight for .plx
My copy of vim does. And I didn't need to do any configuration for
that. But that's not a Perl issue.
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing
Interactive Media Division | down all the noises the baby makes so
Commercial Dynamics Pty. Ltd. | later I can ask him what he meant -
NSW, Australia | Steven Wright
------------------------------
Date: Mon, 18 Dec 2000 15:34:37 -0500
From: "Paul Wasilkoff" <paul_wasilkoff@ucg.org>
Subject: Apache Perl Problem? (Open File)
Message-Id: <t3st948713u58c@corp.supernews.com>
I am trying to data from a web form to a text file - this on an Apache
server. Yet I am getting no action to the file - even though the rest of
the code, including an HTML confirmation screen works fine.
Any suggestions?
Here is a snippet of the code:
##########
open(FILE, $file);
print FILE "** Literature Request **\n";
print FILE " \n";
print FILE "Email: $data{email}\n";
print FILE "\n";
print FILE "Form data:\n";
print FILE "A0:$in{'whofor'}\n";
print FILE "A1:$in{'LNAME'}\n";
print FILE "A2:$in{'FNAME'}\n";
close FILE;
#########
PAW
------------------------------
Date: Mon, 18 Dec 2000 22:13:12 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: Apache Perl Problem? (Open File)
Message-Id: <dwilgaREMOVE-49FEFC.17092718122000@news.mtholyoke.edu>
In article <t3st948713u58c@corp.supernews.com>, "Paul Wasilkoff"
<paul_wasilkoff@ucg.org> wrote:
> I am trying to data from a web form to a text file - this on an Apache
> server. Yet I am getting no action to the file - even though the rest of
> the code, including an HTML confirmation screen works fine.
>
> Any suggestions?
Ever tried adding some error handling to your code? :-)
>
> Here is a snippet of the code:
>
> ##########
> open(FILE, $file);
Try this instead:
open(FILE,">$file") || print "Status: 200\nContent-type: text/plain\n\n$!";
That should tell you why the file can't be opened. Most likely, it's because
the process you're running the web server as doesn't have write permission in
the directory specified by $file.
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: Mon, 18 Dec 2000 20:00:27 +0000
From: Jamie Kincaid <jamie@thale.nott.ac.uk>
Subject: blocked threads
Message-Id: <Pine.SOL.3.96.1001218195228.19599D-100000@thale>
Hi all,
I have a machine which keep falling over due to
"number of blocked threads exceeds maxuthreads for uid 65534"
I've recently added some perl cgi scripts on this machine and was
wondering if it could be due to a buggy cgi script.
Can perl cause errors like this?? - I've never seen anything like it
before.
Jamie
------------------------------
Date: Mon, 18 Dec 2000 14:49:18 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can you help me?
Message-Id: <slrn93sqhu.6qn.tadmc@magna.metronet.com>
Oliver Söder <soeder@ai-lab.fh-furtwangen.de> wrote:
>I am able to programm C++ and know how to use $subject there.
Eh? You know how to use "Can you help me?" in C++?
How do you do that?
Please put the subject of your post in the Subject of your post.
>Is it possible to use these functions under perl? I already tried,
>but there ist no Heap and Stack like under C++.
Deja vu...
Use Deja news.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 18 Dec 2000 15:46:02 -0600
From: Lalit <lalit@engrs.unl.edu>
Subject: CGI script
Message-Id: <3A3E859A.5087742D@engrs.unl.edu>
Hi! I am pretty new to Perl and CGI. We run QNX4.25 on our server with
sql anywhere database. I am trying to develop a web interface for it. A
perl script has to be made to run on a web browser. I have Apache 1.3.9
installed. In the HTML code, I use <FORM METHOD = "POST" ACTION
"/cgi-bin/filename.cgi">
The ScriptAlias set in the httpd.conf is like "ScriptAlias /cgi-bin/
"/usr/local/apache/cgi-bin/".
The file filename.cgi exist in the /usr/local/apache/cgi-bin directory.
When I try to execute it, I get the error in the browser (both IE and
Netscape)saying that I do not have permission access that file. I have
even tried making the permission as -rwxrwxrwx. If you have any ideas I
would really appreciate a detailed response.
Thanks
------------------------------
Date: 18 Dec 2000 21:00:58 GMT
From: rfield@best.com ()
Subject: Configuring dmake for VC++ for Perl build
Message-Id: <91ltua$2dr7$1@nntp1.ba.best.com>
Keywords: dmake perl win9x win98 VC++
I am preparing to build Perl 5.6.0 on a Win98 system, and downloaded
dmake, but find the instructions for configuring it obscure at best.
Has anyone had success, and could let me know what is required?
------------------------------
Date: Mon, 18 Dec 2000 23:20:04 +0100
From: "iLs" <iLs@cyberdude.com>
Subject: existing files
Message-Id: <91m2vb$st$1@dinkel.civ.utwente.nl>
I was trying to write a script that could copy files from one dir to
another, but only if the file doesn't already exist in de second dir.
How can I check for the file to exist ?
greets,
Rob
------------------------------
Date: 18 Dec 2000 20:31:14 GMT
From: nobody@nobody.com (nobody)
Subject: Get epoch seconds range for today
Message-Id: <91ls6i$nlt$1@boile.a2000.nl>
Hi all,
What I want to get is two values:
The epoch seconds for the date: Today 00:00:00
The epoch seconds for the date: Today 23:59:59
does anyone know how to get these. I tried doing something with
time values. But can't figure it out......
I want to findout if an epoch time fits in today's range...
Y. Dobon.
------------------------------
Date: Mon, 18 Dec 2000 15:35:07 -0500
From: Nico F Zigouras <zigouras@mail.med.upenn.edu>
Subject: Re: Get epoch seconds range for today
Message-Id: <Pine.OSF.4.10.10012181534290.12486-100000@dolphin.upenn.edu>
See the Date::Parse module from CPAN. It can convert a real date to epoch
time.
On 18 Dec 2000, nobody wrote:
>Hi all,
>
>What I want to get is two values:
>
>The epoch seconds for the date: Today 00:00:00
>The epoch seconds for the date: Today 23:59:59
>
>does anyone know how to get these. I tried doing something with
>time values. But can't figure it out......
>
>I want to findout if an epoch time fits in today's range...
>
>Y. Dobon.
>
>
>
>
>
------------------------------
Date: Mon, 18 Dec 2000 16:33:17 -0500
From: "Chris Godaire" <chris.nospam.godaire@rcn.com>
Subject: Re: Get epoch seconds range for today
Message-Id: <91lvem$2uk$1@autumn.news.rcn.net>
Wrote these quite a while ago.. It may not be the best way to do it, but it
works. They handle converting from a formatted string (MM-DD-YYYY HH:MM:SS)
to a unix epoch value, and back again.. Changing the times is a simple
matter:
my ($today,undef) = split(' ', epoch_to_string(time());
my $start = string_to_epoch($today . ' 00:00:00');
my $stop = string_to_epoch($today . ' 23:59:00');
print "Day started at $start\n";
print "Day ended at $stop\n";
sub epoch_to_string
{
use Time::localtime;
my($tm);
$tm = localtime($_[0]);
return sprintf("%02d-%02d-%04d
%02d:%02d:%02d",$tm->mon+1,$tm->mday,$tm->year+1900,
$tm->hour,$tm->min,$tm->sec);
}
sub string_to_epoch
{
use Time::Local;
my($epoch,$hour,$min,$sec,$month,$day,$year,$t,$d);
($d,$t) = split(" ",$_[0]);
($month,$day,$year) = split("-",$d);
($hour,$min,$sec) = split(":",$t);
return timelocal($sec,$min,$hour,$day,$month-1,$year);
}
----- Original Message -----
From: "nobody" <nobody@nobody.com>
Newsgroups: comp.lang.perl.misc
Sent: Monday, December 18, 2000 3:31 PM
Subject: Get epoch seconds range for today
> Hi all,
>
> What I want to get is two values:
>
> The epoch seconds for the date: Today 00:00:00
> The epoch seconds for the date: Today 23:59:59
>
> does anyone know how to get these. I tried doing something with
> time values. But can't figure it out......
>
> I want to findout if an epoch time fits in today's range...
>
> Y. Dobon.
>
>
>
------------------------------
Date: Mon, 18 Dec 2000 22:13:50 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Get epoch seconds range for today
Message-Id: <slrn93t2ss.j5f.mgjv@verbruggen.comdyn.com.au>
On 18 Dec 2000 20:31:14 GMT,
nobody <nobody@nobody.com> wrote:
> Hi all,
>
> What I want to get is two values:
>
> The epoch seconds for the date: Today 00:00:00
> The epoch seconds for the date: Today 23:59:59
Use the standard Time::Local module:
> I want to findout if an epoch time fits in today's range...
#!/usr/local/bin/perl -wl
use strict;
use Time::Local;
my @todays_date = (localtime)[3,4,5];
my $time1 = timelocal( 0, 0, 0, @todays_date);
my $time2 = timelocal(23, 59, 59, @todays_date);
my $time = time;
print "Yup" if $time > $time1 && $time < $time2;
Martien
--
Martien Verbruggen |
Interactive Media Division | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: 18 Dec 2000 16:14:15 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Get epoch seconds range for today
Message-Id: <91m27n$5ip$1@boomer.cs.utexas.edu>
In article <91ls6i$nlt$1@boile.a2000.nl>, nobody <nobody@nobody.com> wrote:
>What I want to get is two values:
>
>The epoch seconds for the date: Today 00:00:00
>The epoch seconds for the date: Today 23:59:59
>
>does anyone know how to get these. I tried doing something with
>time values. But can't figure it out......
>
>I want to findout if an epoch time fits in today's range...
Here you go:
#! /usr/local/bin/perl -w
use Time::Local 'timelocal';
@now = localtime;
$first_second_today = timelocal (0, 0, 0, @now[3,4,5]);
$last_second_today = timelocal (59, 59, 23, @now[3,4,5]);
print "Today started at ", scalar localtime $first_second_today, "\n";
print "Today will end at ", scalar localtime $last_second_today, "\n";
Enjoy.
- Logan
------------------------------
Date: Mon, 18 Dec 2000 21:51:18 GMT
From: raymond_ali@my-deja.com
Subject: Hello World with Text::PDF
Message-Id: <91m0sf$dsb$1@nnrp1.deja.com>
Greetings,
I am trying to do a simple Hello World via Text::PDF. Does
any one have an example?
Thanks
Raymond
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 19 Dec 2000 04:15:26 +0800
From: Kelvin <coca88@hotmail.com>
Subject: help !! problem with perl's log function
Message-Id: <3A3E705E.2690EA9D@hotmail.com>
Hi , i would like to ask if anyone knows the workaround for the problem
.. my program is as follows:
#!/usr/bin/perl -w
$up=3;
open (FOUT, ">out")||die print "Cannot open out file \n";
while ($up <= 5.5){
$mama=log($up);
print FOUT " Log $up has value $mama\n";
$up=$up+0.1;
}
the answer given by the calculator varies so much as compared to the
answer given in perl ... i am using version 5.6.0 in both my linux and
windows machine ... both gave the same answer
thanks in advance
kelvin
------------------------------
Date: 18 Dec 2000 21:20:14 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: help !! problem with perl's log function
Message-Id: <91lv2e$39j$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Kelvin
<coca88@hotmail.com>],
who wrote in article <3A3E705E.2690EA9D@hotmail.com>:
> Hi , i would like to ask if anyone knows the workaround for the problem
> .. my program is as follows:
> #!/usr/bin/perl -w
> $up=3;
> open (FOUT, ">out")||die print "Cannot open out file \n";
> while ($up <= 5.5){
> $mama=log($up);
> print FOUT " Log $up has value $mama\n";
> $up=$up+0.1;
> }
>
> the answer given by the calculator varies so much as compared to the
> answer given in perl ... i am using version 5.6.0 in both my linux and
> windows machine ... both gave the same answer
Calculators do not have garanteed precision of the output, as IEEE
arithmetic has. Many calculators have bugs too.
Here is one data point for you:
GP/PARI CALCULATOR Version 2.0.17 (beta)
UltraSparc (MicroSparc kernel) 32-bit version
(readline v4.0 enabled, extended help available)
Copyright (C) 1989-1999 by
C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier.
Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.
realprecision = 28 significant digits
seriesprecision = 16 significant terms
format = g0.28
parisize = 4000000, primelimit = 500000
? \p 300
realprecision = 308 significant digits (300 digits displayed)
? log(4.3)
%1 = 1.4586150226995167394548510586614828279580346962527824391583573639552865641
95633958301594792994398988555537896325810542914350024916827676863915009757433846
14468819991857358847339292992524671060670305921244153776381623561515411230748211
757055768832811842680618725806006547345129800880422031845553795768
Ilya
------------------------------
Date: 18 Dec 2000 15:53:34 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: help !! problem with perl's log function
Message-Id: <91m10u$5gl$1@boomer.cs.utexas.edu>
In article <3A3E705E.2690EA9D@hotmail.com>, Kelvin <coca88@hotmail.com> wrote:
>#!/usr/bin/perl -w
>$up=3;
>open (FOUT, ">out")||die print "Cannot open out file \n";
>while ($up <= 5.5){
>$mama=log($up);
>print FOUT " Log $up has value $mama\n";
>$up=$up+0.1;
>}
>
>the answer given by the calculator varies so much as compared to the
>answer given in perl ... i am using version 5.6.0 in both my linux and
>windows machine ... both gave the same answer
Perhaps you're confused about natural logarithms versus base
10 logarithms. Does your calculator give 2 for the answer
to log 100? If so, it's doing base 10. Perl does natural
logarithms, which are base e. (e equals about 2.71828.)
If you want Perl to do base 10 logarithms, you'll
want to use the properties of logarithms as
suggested in the documentation ("perldoc -f log").
By the way, your for loop would be much cleaner looking like this:
for ($up = 3; $up <= 5.5; $up += 0.1)
{
# body goes here
}
Also, I would like to point out that, since 0.1 can't be exactly
represented as a binary floating point number, your loop is going to
accumulate lots of round-off errors. Another way of saying this it
that adding the floating-point representation of 0.1 to 3 twenty-five
times is going to give you a number that's slightly less than 5.5, not
equal to it. For a demonstration of this phenomenon, try this:
for ($x = 0; $x < 1000; $x+=0.1)
{
print "$x\n";
}
Your loop only works because you've happened upon values where this
doesn't matter much.
Hope that helps.
- Logan
------------------------------
Date: Mon, 18 Dec 2000 16:42:32 -0800
From: "Jason Kiss" <Please_reply@this.group>
Subject: Help !!!
Message-Id: <dsv%5.74105$%j3.902621@news6.giganews.com>
Hi,
I need to modify these line to my needs...When I run this script it does
everything correct except it won't make the index.shtml to chmod 755
(-rwxr-xr-x)
Please Help !!!
J
# Create directory
mkdir ("$config{'root_dir'}/$in{'username'}", 0755) || &error_html("Could
not create Folder Name directory: $!");
# Create default html
open (INDEX,">$config{'root_dir'}/$in{'username'}/index.shtml") ||
&error_html("Could not create default Folder index.shtml: $!");
print INDEX qq~
------------------------------
Date: Tue, 19 Dec 2000 09:37:14 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Hiding source
Message-Id: <91lshr$fhk$1@hermes.nz.eds.com>
<msalerno@my-deja.com> wrote in message news:91lkle$2a2$1@nnrp1.deja.com...
> In article <3A3DB752.301F9992@videotron.ca>,
> Mercille <gmercille@videotron.ca> wrote:
> > I heard that it was impossible to totally hide the source of a script
> > written in perl. I kinda agree with that, since the script has to be
> > world-read+execute, but still, I haven't figured out a way to read my
> > own source from the web. I'm no professional hacker, but I would like
> > to know how they can do this to see what kind of security measures I
> can
> > take.
> >
> > Please try and get the source of
> > http://www.info.polymtl.ca/~sleeping/cgi-bin/test.cgi and if you can
> see
> > the source, tell me how you did it (using which software, which
> > strategy, etc.) Thanks a lot.
> >
> >
> I am pretty sure that the scripts in the cgi-bin don't have to have read
> permissions. Also if you are using apache, you can setup all kinds of
> directory directives for tighter security. My suggestion to you is to
> post this message to a newsgroup that has something to do with your web
> server. This is not really a perl issue.
Hence the reason for your incorrect information. A script has to have read
permission in order for it to run.
------------------------------
Date: Mon, 18 Dec 2000 22:17:15 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Hiding source
Message-Id: <slrn93t33a.j5f.mgjv@verbruggen.comdyn.com.au>
On Mon, 18 Dec 2000 18:22:45 GMT,
msalerno@my-deja.com <msalerno@my-deja.com> wrote:
> In article <3A3DB752.301F9992@videotron.ca>,
> Mercille <gmercille@videotron.ca> wrote:
>> I heard that it was impossible to totally hide the source of a script
>> written in perl. I kinda agree with that, since the script has to be
>> world-read+execute,
>>
> I am pretty sure that the scripts in the cgi-bin don't have to have read
> permissions. Also if you are using apache, you can setup all kinds of
They do. The user that executes the source has to have read permission
to the file. Otherwise the file can't be read, the program not
compiled, and not executed.
That doesn't mean that they have to be world-readable though. They
have to be readable by whomever will execute the script.
> directory directives for tighter security. My suggestion to you is to
> post this message to a newsgroup that has something to do with your web
> server. This is not really a perl issue.
That is good and sound advice.
Martien
--
Martien Verbruggen |
Interactive Media Division | In the fight between you and the
Commercial Dynamics Pty. Ltd. | world, back the world - Franz Kafka
NSW, Australia |
------------------------------
Date: Mon, 18 Dec 2000 22:30:05 -0000
From: Ryan <ryanmh_99@yahoo.com>
Subject: How to secure HTTP form POST by a CGI
Message-Id: <t3t3vd7p5dgea1@corp.supernews.com>
I need to securely send information from a CGI (Perl Script) to another
CGI that is NOT on my server using a HTTP form POST method. How do I do
this?? Thanks
Ryan
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Mon, 18 Dec 2000 19:36:24 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Is Perl dying?
Message-Id: <91lovn$6dv$1@nnrp1.deja.com>
In article <brian+usenet-760ED3.16545116122000@news.panix.com>,
brian d foy <brian+usenet@smithrenaud.com> wrote:
> In article <t3nnekliavnp79@corp.supernews.com>, "Randy Harris"
> <harrisr@bignet.net> wrote:
>
> > brian d foy <brian+usenet@smithrenaud.com> wrote in message
> > news:brian+usenet-0182D5.16135416122000@news.panix.com...
> > > In article <3A3ABE95.56F9550E@earthlink.net>, Andrew Lee
> > > <andrew_lee@earthlink.net> wrote:
>
> > > your assumption is faulty. the major problems with team
development
> > > do not include the choice of language since those problems exist
> > > no matter the language being used.
>
> > > however, you can't get rid of bad managers.
>
> > In my experience, the major problems with team development stem from
> > neither bad languages nor bad managers but bad practices.
>
> bad practices? whose fault is that? ( think about why there
> are (theoretically) managers ). ;)
>
I was once told that any manager is somebody who has finally been
promoted to his level of incompetence.
Most managers I have come across so far coerce people into using VB,
because in the BUSINESS world, jobs get done in VB, where it is
SCIENTIFICALLY proven that development in VB is much faster than in
anything else.
<shrug>
B
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 18 Dec 2000 15:28:52 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Is Perl dying?
Message-Id: <91lvik$59s$1@boomer.cs.utexas.edu>
In article <91lovn$6dv$1@nnrp1.deja.com>,
Brendon Caligari <bcaligari@my-deja.com> wrote:
>Most managers I have come across so far coerce people into using VB,
>because in the BUSINESS world, jobs get done in VB, where it is
>SCIENTIFICALLY proven that development in VB is much faster than in
>anything else.
Why can't managers just tell the truth and say this?
We are using this product because I personally feel most
comfortable with it and I am in charge. It may or may
not be the best solution from a technical point of
view. I don't know. What I do know is that I have
personally seen projects succeed when using this
product, whereas I have no firsthand knowledge of
<insert name of better technology>. So, I'm making the
conservative, easy decision and going with what I know.
Or this?
VB programmers are cheaper to hire. I do not have enough
technical knowledge to be convinced that I'm actually getting
more for my money when I hire more expensive talent to work
in some other language. Furthermore, the technical people
around here grumble all the time, and I have no good reason
to believe that their comments on this issue are anything
more than just the usual grumbling or personal preferences.
Instead, they often make up lies like the one you mentioned.
Actually, I think the fact is that there are usually problems on
both sides. At least one of the technical people usually knows
what is best, but communicating this to the boss is difficult.
There may be the fact that few people (technical people being far
from an exception) have good enough communications skills, the fact
that usually there are other technical people who champion the
wrong solution because they're somehow infatuated with it, and the
fact that often managers don't have an appreciation for the fact
that there really are significant differences in the usefulness of
competing technologies. Oh, and the hype that is usually coming
from vendors, other managers, etc. doesn't help either.
I guess my point, if I have one, is that lots of different scenarios
can lead a company to use a technologies, only one of which is the
commonly-imagined one where the technical people present (at the
right time and in the right way) well thought-out, good reasoning
for using the right technology, but the boss ignores them.
- Logan
------------------------------
Date: Mon, 18 Dec 2000 22:06:58 GMT
From: Tor Iver Wilhelmsen <toriw@chello.no>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE oflanguages??)
Message-Id: <wkvgsho041.fsf@mail.multinett.no>
Just Me <just_me@nowhere.com> writes:
> Well, now I really wonder why people have to reinvent the wheel over
> and over again. Smalltalk has been here since the 80's and has
> proven its value on many serious projects but in the last couple of
> years or so I am seeing a flood of new languages every year. It's
> like a tower of Babel. We all had VisualWorks Smalltalk doing
> exactly the same thing as Java and Python are doing now already 10
> years ago and still these things are regarded as something new...
No, they are regarded as something _inexpensive_. VisualWorks and the
rest killed their baby market-wise by charging an arm and a leg for
their products. The JDK is _free_.
So taker your Tower of Ivory (the close-minded Smalltalk community)
and stick it where Sun doesn't shine. :-)
--
Tor Iver Wilhelmsen <toriw@chello.no>
Life stinks, and don't get me started on the terrible sequel.
------------------------------
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 5142
**************************************