[12746] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 156 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 15 15:07:15 1999

Date: Thu, 15 Jul 1999 12:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 15 Jul 1999     Volume: 9 Number: 156

Today's topics:
    Re: < 1 Second Timing <lakmal@exchange.ml.com>
    Re: Built perl 5.005_03 on AIX 4.3.2? <nickgeo@merle.acns.nwu.edu>
        Can't install two perl modules. Help please. <zzhang@bayou.uh.edu>
    Re: crypt returns different values since ISP upgrade. <dot@dotat.at>
    Re: crypt() doesn't decrypt <qwerty@post.utfors.se>
        Do you think I can use this instead of form button ? <factory@factory.co.kr>
        fork, children, and ground <jerrad@networkengines.com>
    Re: Future of Perl (Tad McClellan)
    Re: getting modify times with perl&unix (Matthew Bafford)
    Re: How to delete an element in the middle of an array <psutton@microsoft.com>
        how to get command line filename argument back? <tom.kralidis@ccrs.nrcanDOTgc.ca>
    Re: knowing it's own name? <qwerty@post.utfors.se>
        loop problems <jgc5a@j2.mail.virginia.edu>
    Re: MySQL with perl <johnyick@hongkong.com>
        Net::NNTP problem <oe@sob-online.net>
    Re: Old database is erased when I add new information <flavell@mail.cern.ch>
    Re: Old database is erased when I add new information (John Stanley)
    Re: Old database is erased when I add new information (John Stanley)
    Re: Old database is erased when I add new information (Perulinks)
    Re: Perl on NT - SIG handlers <pandich@my-deja.com>
    Re: Perl...sockets. <smiles@wfubmc.edu>
        prob compiling under aix 4.2.1 via gcc wb1916@ctmail.snet.com
        regexp in substr? <josh@titan.byu.edu>
    Re: regexp in substr? <jeffp@crusoe.net>
    Re: script doesn't seem to be updating database....why? <mwkohout@csbsju.edu>
    Re: Statistics for comp.lang.perl.misc (Gabriel Russell)
    Re: Test if a File Exists? (James Wetterau)
    Re: Tiny error in perlfaq5 (John Borwick)
    Re: Tiny error in perlfaq5 <jcreed@cyclone.jprc.com>
    Re: Tiny error in perlfaq5 <tchrist@mox.perl.com>
    Re: Tiny error in perlfaq5 <jeffp@crusoe.net>
    Re: Tiny error in perlfaq5 (Randal L. Schwartz)
        using ParseWords <dchender@esn.net>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 15 Jul 1999 14:33:58 -0400
From: Lakmal Jinadasa <lakmal@exchange.ml.com>
Subject: Re: < 1 Second Timing
Message-Id: <378E2996.A22782B5@exchange.ml.com>

Use Time::HiRes module as below

use Time::HiRes qw(gettimeofday);

$t0 = gettimeofday;
<Your Process Here>
$t1 = gettimeofday;
$el = ($t1-$t0)*1000 #Gives $el in ms



wired2000@my-deja.com wrote:

> Hi,
>
> Is there a way in perl to track the amount of time to do certain
> processes?
>
> The main problem I see is that many of the operations are under 1
> second which has caused problems before since I can't use time in epoch
> seconds before and after since this will round to the nearest second.
> If possible, down to milliseconds would be nice but at least to 1
> decimal place of a second is required. Any ideas on how to track this?
>
> General Idea:
> Start Timer
>  Do Operations
> End Timer
>
> $timeused = XXXX ms or X.X seconds
>
> Any feedback appreciated.
> Charles
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



------------------------------

Date: Thu, 15 Jul 1999 12:19:10 -0500
From: Nicholas Geovanis  <nickgeo@merle.acns.nwu.edu>
Subject: Re: Built perl 5.005_03 on AIX 4.3.2?
Message-Id: <Pine.HPP.3.93.990715121440.7584C-100000@merle.acns.nwu.edu>

On Wed, 14 Jul 1999, Nicholas Geovanis wrote:

> Hi -
>   Using IBM C and C++ 3.6.4 with a couple of fixes on AIX 4.3.2, perl
> 5.005_03 builds OK (apparently). However three tests fail:
> pragma/overload, lib/tie-push and lib/safe2. Has anyone resolved these or
> tested successfully with a different compiler, or.....? Thanks.

To set the record straight, I compiled perl 5.005_03 successfully with the
IBM C for AIX 4.4 compiler and perl subsequently passed all tests. The one
IBM fix available for this compiler is recommended, however, as recent
Apaches won't compile without that fix. There are PRs on the subject at
the Apache web site.

+-------------------->
| Nick Geovanis
| IT Computing Svcs
| Northwestern Univ
V n-geovanis@nwu.edu



------------------------------

Date: Thu, 15 Jul 1999 12:56:05 -0500
From: Zhengdong Zhang <zzhang@bayou.uh.edu>
Subject: Can't install two perl modules. Help please.
Message-Id: <378E20B5.749F@bayou.uh.edu>

I tried to install several perl modules yesterday on a Red Hat Linux 5.0
machine using CPAN module. All but LWP and DBD::mysql were successfully
installed.
Both of the installation of LWP and DBD::mysql cannot pass the test(DBI
module has been installed). For LWP, the error message is:

 ...(messages above are omitted)...
Running make test
/usr/bin/perl -e 'use Config; chdir q{./blib/script}; foreach (qw(GET
HEAD POST)) {' \
-e 'unlink "$_";' \
-e 'system("$Config{\"lns\"} lwp-request $_") && die; }'
/usr/bin/perl t/TEST 0
base/common-req.....ok
base/cookies........ok
base/date...........ok
base/headers-auth...ok
base/headers-etag...ok
base/headers-util...ok
base/headers........ok
base/listing........ok
base/mediatypes.....ok
base/message........ok
base/negotiate......ok
base/response.......ok
base/status.........ok
robot/rules-dbm.....ok
robot/rules.........ok
robot/ua............HTTP Server terminated
FAILED tests 1-3, 5, 7
        Failed 5/7 tests, 28.57% okay
local/autoload......ok
local/get...........ok
local/http..........HTTP Server terminated
Can't call method "is_redirect" without a package or object reference at
local/http.t line 186, <DAEMON> chunk 1.
dubious
        Test returned status 9 (wstat 2304, 0x900)
Undefined subroutine &Test::Harness::WCOREDUMP called at
/usr/lib/perl5/Test/Harness.pm line 252.
make: *** [test] Error 2
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force




For DBD::mysql, the message is: 


 CPAN.pm: Going to build JWIED/Msql-Mysql-modules-1.2201.tar.gz

Which drivers do you want to install?

    1)  MySQL only
    2)  mSQL only (either of mSQL 1 or mSQL 2)
    3)  MySQL and mSQL (either of mSQL 1 or mSQL 2)
    4)  mSQL 1 and mSQL 2
    5)  MySQL, mSQL 1 and mSQL 2

Enter the appropriate number:  [3] 1


Do you want to install the MysqlPerl emulation? You might keep your old
Mysql module (to be distinguished from DBD::mysql!) if you are concerned
about compatibility to existing applications! [n] 
Where is your MySQL installed? Please tell me the directory that
contains the subdir 'include'. [/usr] 
Which database should I use for testing the MySQL drivers? [test] 
On which host is database test running (hostname, ip address
or host:port) [localhost] 
User name for connecting to database test? [undef] 
Password for connecting to database test? [undef] 
Creating files for MySQL ....................
Checking if your kit is complete...
Looks good
Using DBI 1.13 installed in /usr/lib/perl5/site_perl/i386-linux/auto/DBI
Writing Makefile for DBD::mysql
Writing Makefile for Msql-Mysql-modules
mkdir ./blib
mkdir ./blib/lib
mkdir ./blib/arch
mkdir ./blib/arch/auto
mkdir ./blib/arch/auto/Msql-Mysql-modules
mkdir ./blib/lib/auto
mkdir ./blib/lib/auto/Msql-Mysql-modules
mkdir ./blib/man1
/usr/bin/perl -I./blib/arch -I./blib/lib
-I/usr/lib/perl5/i386-linux/5.00404 \
-I/usr/lib/perl5 -Ilib -MExtUtils::PerlPP \
-e "ppp('dbd/dbimon.in', 'dbimon', 'lib/DBD/mysql/Install/Config.pm')"
pod2text mysql/lib/DBD/mysql.pm >README
/bin/sh: pod2text: command not found
make: *** [README] Error 127
  /usr/bin/make  -- NOT OK
Running make test
  Oops, make had returned bad status
Running make install
  Oops, make had returned bad status

cpan>


Any ideas and suggestions will be appreciated. Thanks.

-- 
Have a nice day,
zz
zzhang@bayou.uh.edu


------------------------------

Date: Thu, 15 Jul 1999 17:05:03 GMT
From: Tony Finch <dot@dotat.at>
Subject: Re: crypt returns different values since ISP upgrade.
Message-Id: <932058303.20247.0.nnrp-14.c30b3753@news.demon.co.uk>

rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
>Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu> wrote:
>
>> if (crypt($user, substr($passwd, 0, 2)) eq $passwd) {
>
>crypt() truncates the salt to two characters for you, so doing the
>substr() is redundant.

It's also wrong for exotic crypt()s.

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net
Winner, International Obfuscated C Code Competition 1998


------------------------------

Date: Wed, 14 Jul 1999 19:04:47 +0200
From: "Dr. Who" <qwerty@post.utfors.se>
Subject: Re: crypt() doesn't decrypt
Message-Id: <378CC32F.2952D495@post.utfors.se>

"Dr. Who" wrote:

> what's the point in encrypting someting that is decryptable?
> .. or is there really a way? :)

-
it's easy not to think twice ..
 .. but it just doesnt scream logic around using the encrypted string as
salt ..
emh .. but anyway .. it worked..



------------------------------

Date: Fri, 16 Jul 1999 02:38:48 +0900
From: "Yeong Mo/Director Hana co." <factory@factory.co.kr>
Subject: Do you think I can use this instead of form button ?
Message-Id: <7ml5po$tmu$1@news1.kornet.net>

Do you think I can use this instead of form button ?

<a href ="test.cgi?name=action&value=001>click to print name and action</a>
From click this, test.cgi should print "---- name = action ---- value = 001"

LET'S think normal way.

<html><body>
      <form action="test.cgi" method="POST">
        <input type="submit" name="action" value="001">
   </form>
</body></html>

With this form button, it calls test.cgi and prints
---- name = action ---- value = 001

# This is test.cgi.
#!/usr/bin/perl
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $input);
    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $name =~ tr/+/ /;
    $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $value =~ s/<([^>]|\n)*>//g;
  $FORM{$name} = $value;
    }
print "Content-type: text/html\n\n";
print "----- name  = $name  \n";
print "----- value = $value \n";
# Then, this prints $name and $value
1;

 Thank you in advance.




------------------------------

Date: Thu, 15 Jul 1999 15:03:16 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: fork, children, and ground
Message-Id: <378E3074.D35B967F@networkengines.com>

Is it possible to have the child of a background process to come into the foreground when it forks?

Thanks!

PS> Please (b)cc me with any replies...


------------------------------

Date: Thu, 15 Jul 1999 09:05:02 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Future of Perl
Message-Id: <u9mkm7.7rl.ln@magna.metronet.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote:

: I
: certainly couldnt be arsed to use Jave for most of the things I do
                       ^^^^^


   You are toooo clever!

   A cleverly disquised management put down, 
   or just a serendipitous typo?

   Just leave us wondering...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 15 Jul 1999 17:51:20 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: getting modify times with perl&unix
Message-Id: <scpj3.448$cd5.28752@typ42b.nn.bcandid.com>

Larry Rosler), thinking with his hands, posted the following to
comp.lang.perl.misc: 
: In article <slrn7opq3a.4jl.*@dragons.duesouth.net> on Wed, 14 Jul 1999 
: 20:08:43 GMT, Matthew Bafford <*@dragons.duesouth.net> says...
: ...
: > $mtime = qx!remsh $hostname "perl -e 'print modtime'"!;
:
: Please clarify what this actually does.

I really didn't expect anyone to have any problems with this.

Oh well, perhaps I should have written:

# replace <stat and print modtime> with the appropriate code:
$mtime = qx!remsh $hostname "perl -e '<stat and print modtime>'"!;
 
: (Just Another Larry) Rosler

--Matthew


------------------------------

Date: Thu, 15 Jul 1999 11:52:18 -0700
From: "Paul Sutton" <psutton@microsoft.com>
Subject: Re: How to delete an element in the middle of an array
Message-Id: <7mlal5$s4a@news.dns.microsoft.com>

"Steve Montgomery" <monty@torranceweb.com> wrote in message
news:378D2108.F6D12C7F@torranceweb.com...
> If I read a database (plain text file) into an array, how do I delete
> one of lines of the database  ( one element - let's call it $databse[10])
> and shift the remaining lines up to fill the gap.
>
> I've seen a DELETE command when using associative arrays but nothing
> in my book talks about standard arrays.
>
> Is there also a simple way to delete many elements at one time? If you
> delete one, then I'm assuming the remaining elements will be called by
> a number that is one less than it was called before. Is deleting one at
> a time the only way to go?

Yes to both: use splice.

Paul





------------------------------

Date: Thu, 15 Jul 1999 13:45:24 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: how to get command line filename argument back?
Message-Id: <378E1E34.FCC14739@ccrs.nrcanDOTgc.ca>

Hi,

The script I'm writing peruses a txt file, extracts the info needed and
stores them to variables.  I now want to create a new file (same id as
the txt file, given as argument on command line), with a different
extension.  I have extracted the info from the first file by:

while <> {
if (stuff) {
stuff
  }
}

After this statement I am ready to write the variables to file.  Any
suggestions?  I have tried 
($file = shift @ARGV);, but get no results (script freezes, dies)

TIA

 ..Tom

-----------------------------------------------------------------------------------------
Tom Kralidis                                  Geo-Spatial Technologist 
Canada Centre for Remote Sensing              Tel: (613) 947-1828
588 Booth Street , Room 241                   Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7                     
http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------


------------------------------

Date: Wed, 14 Jul 1999 18:58:46 +0200
From: "Dr. Who" <qwerty@post.utfors.se>
Subject: Re: knowing it's own name?
Message-Id: <378CC1C6.D5B19F23@post.utfors.se>

thanks .. i assume :)
 .. even found 'perldoc perl' .. kind of useful..



------------------------------

Date: Thu, 15 Jul 1999 14:07:14 -0400
From: James Gerard Coleman <jgc5a@j2.mail.virginia.edu>
Subject: loop problems
Message-Id: <Pine.A41.4.05.9907151403070.36614-100000@node12.unix.Virginia.EDU>

ok..  this is really confusing me..

i've got this set of code:

while(<INFILE>) {
    if ($_ =~ /authenticat/) {		# look and see if value exists 
	$tempauth[$i++] = $_;		# put values into an array
	for ($j; $j<=$#tempauth; $j++) {
	    for ($k; $k<=$#cryptokeys; $k++) {
		print "$j ";
	    }
	}
    }
}

$#tempauth has a value of 74, $#cryptokeys has a value of ~740.  what i
expected when i ran this loop is for the number $j(0 through 74) to be
displayed 740 times for each value of j.   what i get instead is a few
lines of blank space....

any ideas on this one?  am i initializing the variables j and k
incorrctly?  should they be set to "for ($k=0; etc)" ?  the probelm is
that last time i tried that, i got an error that autoincrement wouldn't
work on a constant...

thanks in advance,
jim



------------------------------

Date: Fri, 16 Jul 1999 01:14:05 -0000
From: "Johnson ¬ù¿«­Ó¥J" <johnyick@hongkong.com>
Subject: Re: MySQL with perl
Message-Id: <7ml4me$kqr$1@imsp009a.netvigator.com>

thanx a lots
Alexander Farber <eedalf@eed.ericsson.se> wrote in message
news:378D9C9C.244726C5@eed.ericsson.se...
> "Johnson ¬ù¿«­Ó¥J" wrote:
> > which homepage teach Mysql with perl except its official site?
>
> Hi, there'll be a book "MySQL & mSQL" published next month
> by O'Reilly: http://www.oreilly.com/catalog/msql/index.html
>
> /Alex




------------------------------

Date: Thu, 15 Jul 1999 20:30:55 +0200
From: Oliver Ertl <oe@sob-online.net>
Subject: Net::NNTP problem
Message-Id: <378E28DF.CFF7BA79@sob-online.net>

Hello,

why is the program below not working ?


#!/usr/bin/perl
open(DB, "newsserver.db");    # Open the file
@nntpserver = <DB>;           # Read it into an array
close(DB);                    # Close the file

foreach $hostname (@nntpserver) {
print "\n";
print "Fetching newsgroups from $hostname\n";

my $nntp = Net::NNTP->new("$hostname", Timeout=>60, Debug=>On) | die
"Couldn't connect to server $hostname";
my $list = $nntp->list();

open(OUTF,">groups/$hostname");
 for my $group (sort keys %{$list}) {         # should sort I guess
  my $info = $list->{$group};
  print OUTF "$group\t";                      # group name
  print OUTF "($info->[0] - $info->[1])";     # first and last article
  for (my $i=2;$i<@{$info};$i++) {            # slow (but only 1 field
over here anyway)
   print OUTF "$info->[$i]";                  # extra information
  }
  print OUTF "\n";
 }
close(OUTF);

print "Done.\n";
print "\n";

$lines = 0;
open(FILE, "groups/$hostname") or die "Can't open $filename";
 while (sysread FILE, $buffer, 4096) {
  $lines += ($buffer =~ tr/\n//);
 }
 print "Newsserver    : $hostname\n";
 print "Port          : 119\n";
 print "No. of groups : $lines\n\n";
close FILE;
}

--
Suedostbayern Online        Tel ......: +49 8679 912213
Oliver Ertl                 Fax ......: +49 8679 969742
Talhauser Str. 18           Mobil ....: +49 172 8352913
84508 Burgkirchen/Alz       eMail ....: oe@sob-online.net
Germany                     Homepage .: http://www.sob-online.net


------------------------------

Date: Thu, 15 Jul 1999 19:05:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Old database is erased when I add new information
Message-Id: <Pine.HPP.3.95a.990715190320.19774B-100000@hpplus03.cern.ch>

On 15 Jul 1999, John Stanley wrote:

> I'm not sure why you think the actions of someone who is not qualified
> to modify code is a straw man when we are discussing the problem of
> people who are not qualified to modify code breaking the code and
> expecting fixes from the author. 

Staw men?  Many's the time that I have hacked a binary to fix a problem
in a program for which I didn't have the source.

Hiding the source is no solution to your perceived problem.




------------------------------

Date: 15 Jul 1999 17:55:05 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Old database is erased when I add new information
Message-Id: <7ml79p$puk$1@news.NERO.NET>

In article <7mkqm5$pld$3@info2.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <7micah$9l1$1@news.nero.net>,
>	stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>: In article <7mibhq$9j1$4@info2.uah.edu>,
>:     Greg Bacon <gbacon@cs.uah.edu> wrote:
>: >Hogwash.  If I want to make modification to my Ranger and end up
>: >damaging my truck, people would laugh me out of town if I tried to
>: >force Ford to fix my screwup.  
>: 
>: What "people" would do is irrelevant.
>
>How is what people would do irrelevant when we're discussing what
>people would do in certain situations?

Ha. Ha. You just called my statement about what someone would do a
"straw man". Now you seem to be relying on what someone would do.

When it comes to having to spend time fixing what someone else broke,
what "people" would laugh at is irrelevant. That's the context of your
reference to "people". What is relevant is the time you will have to
waste dealing with the problem.

>: The fact that you are in the Ford
>: dealership expecting them to fix what you broke for whatever you offer
>: them to fix it, and then start complaining in public how Ford is
>: unethical for not fixing your truck is relevant. That is what this guy is
>: doing.
>
>Try to stick the point.  You were talking about demanding free fixes,
>but now you're talking about offering some compensation for a fix.
>There's quite a difference.

No, not when the author is not interested in doing it for free or for
whatever is being offered. The luser who is complaining about the code
here later claimed that he was offering money, but it doesn't change the
issue. The author he was complaining about is not under any obligation
to fix code the luser broke whether or not the luser is offering money.

>: Some might. Some wouldn't. If you believe they owe you a fix, why
>: wouldn't anyone else? 
>
>You don't really want to start down that slippery slope, do you?

Well, if what "people" would laugh at is relevant as you claim, then
what they would believe Ford owes you is as relevant. Which is it? Is
"people" relevant or not?

>: Hardly. Everyone has a text editor -- they come with the computer.
>
>So what?  I have knives in my kitchen.  I'm carrying a pocket knife.

Do you edit your code with a knife? Hmmm...

>If I were visited with the desire to start performing surgeries,

How often do you see professional surgeons using pocket knives in the
operating theater? How often do you see professional programmers using a
text editor to fix code? Quite a bit for the latter, not ever for the
former. 

>should that wish be accommodated just because I happen to have tools
>that a surgeon might use?  

Well, I guess there's why you won't ever get the point. You think a
surgeon would use a pocket knife to perform an operation. You haven't
noticed all the other tools that a surgeon requires before he operates.
You haven't noticed that perl and a text editor are all someone needs to
program. You haven't noticed the difference between modifying someone's
code (assisting in an operation) and writing a new program ("start
performing surgeries...").

>Would I then also be entitled to free legal help 

Free legal help? When did this become an issue of free legal help?

>: Not everyone has the tools to take a truck apart, and even if they do,
>: there is no grease to clean up when you edit code.
>
>There are no bones in ice cream either.  So what?

I didn't start the truck analogy. Now you want to talk about ice cream.

When you take your truck apart, you get greasy. Avoiding that grease is
one of the reasons that people take their cars to a mechanic. When you
edit code, there is no grease under your fingernails. Grease does not
get onto your clothes and stain them. "Bones" in your "ice cream" have
nothing to do with it.

That deterrance exists for truck repair but not for code. The only
thing to stop someone from trying to fix your code, if he has a copy of
the source, is his knowledge that he doesn't know what he is doing.
He's got all the tools. He's got the code. If he doesn't know he
doesn't know what he is doing, there is nothing stopping him. 



------------------------------

Date: 15 Jul 1999 18:01:41 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Old database is erased when I add new information
Message-Id: <7ml7m5$pvs$1@news.NERO.NET>

In article <Pine.HPP.3.95a.990715190320.19774B-100000@hpplus03.cern.ch>,
Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On 15 Jul 1999, John Stanley wrote:
>
>> I'm not sure why you think the actions of someone who is not qualified
>> to modify code is a straw man when we are discussing the problem of
>> people who are not qualified to modify code breaking the code and
>> expecting fixes from the author. 
>
>Staw men?  Many's the time that I have hacked a binary to fix a problem
>in a program for which I didn't have the source.

And I would suspect that you are a programmer who has some idea of how
to program. I suspect that you would be upfront enough to admit that
you broke the code and have made a backup copy of the previous version
that you can recover. Most poeple who are not programmers have no idea
how to "hack a binary". I'd suspect that most people who ARE
programmers don't know how to hack a binary.

Most people who are not programmers know how to use a text editor.

>Hiding the source is no solution to your perceived problem.

You are wrong. It may not stop you, but it will stop people who don't
really know what they are doing. They're the ones who create the
problems. 



------------------------------

Date: 15 Jul 1999 18:13:46 GMT
From: perulinks@aol.com (Perulinks)
Subject: Re: Old database is erased when I add new information
Message-Id: <19990715141346.18215.00000427@ng-fj1.aol.com>

I might not be so qualified like you guys, but if you mean that to "enhance" a
code that works is trying to "fix some bugs" that is wrong.  

What I tried to fix is the fact that there was a way that supposedly you could
erased URLs using a form.  This form didn't work--not even from the begining.

What it was working before, as you pointed before was the search engine.  You
could type a search word, and the scrips would come on with an answer.

If you would just read my first posting, you could see that I spent just two or
three lines mentioning that the author was unable or unwilling to answer my
emails.  I believe I mentioned too phone calls somewhere.  I spent a lot of
time talking about the technical aspect of the problem. I just wanted some
clues, that is why I didn't paste the whole code (which is very long).  Some of
you focused in the negative, non-technical aspect of the problem to jump to
conclusions (based on wrong assumtions such as that I tried to get a "free"
"fix"--two wrong assumptions).

In short, if you are the type of programmer who writes a code that doesn't work
100% well from the begining once installed (by the author too), and then can't
be found (by emails or phone calls), nobody would buy your code.

Yes I did  criticize him for not backing up his code--or at least for not being
very accesible.  But I did ALSO praised him for having a code that would be
very useful (if it worked up properly).  I ALWAYS TRY TO BE FAIR.

But again, you chose to focus in that narrow, negative aspect of the message
instead of answering the central, main topic.

I would challenge you to tell that you your customers that you don't have an
obligation to sell a code that doesn't work 100% well (that is, some functions
work perfectly well and some don't).  I would challenge you to call them
"idiots" just because they can't program.  I would like to see if they would
ever buy from you. (why would they come to you in the first place if they know
how to program?).

I only got one message that went straight to the point with one simple answer. 
One that focused on the central problem of the message--not on a minor point I
had to mentioned so nobody would advice me: "Go to the author of the code so he
could fix it."  

One small advise, don't get so upset when you answer messages. 

Carlos


------------------------------

Date: Thu, 15 Jul 1999 17:29:57 GMT
From: Stephen Pandich <pandich@my-deja.com>
Subject: Re: Perl on NT - SIG handlers
Message-Id: <7ml5q4$m0c$1@nnrp1.deja.com>


> > I have a fair amount of experience with Perl on UNIX, but I am still
> > pretty new to the Perl on NT world. Is anyone aware of something
like
> > signal handlers for NT perl?
> >
> > I am specifically looking for ways to trap control-c.
>
> Did you try setting $SIG{INT} to a handler?  It should work the same
on
> NT as on Unix.
>
> --

Larry,

I tried $SIG{'INT'} and it did not work when I did a control-c from the
command prompt. The program merely exits (like a kill -9)

Thanks,
Steve


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Thu, 15 Jul 1999 13:59:28 -0400
From: Steve Miles <smiles@wfubmc.edu>
Subject: Re: Perl...sockets.
Message-Id: <378E2180.605EB3D2@wfubmc.edu>

Search Amazon.com or go to oreilly.com and look for:

"Web Client Programming with Perl"  by Clinton Wong

Len Weaver wrote:

> Hello,
>
>         I'm looking for a good book explaining socket programming
> using Perl.  Any recommendations would be appreaciated.
>
> Thanks in advance,
> Len
> ---
> Len Weaver
> Meritsoft Corporation
> len.weaver@meritsoft.net

--
=============================================
Steve Miles (smiles@wfubmc.edu)
----> http://www.groundbreak.com  <----
Wake Forest University School of Medicine
5019 Hanes, Medical Center Blvd.
Winston-Salem, NC 27157
Phone: 336.716.0454     FAX: 336.716.7200
=============================================




------------------------------

Date: Thu, 15 Jul 1999 17:50:59 GMT
From: wb1916@ctmail.snet.com
Subject: prob compiling under aix 4.2.1 via gcc
Message-Id: <7ml71t$mio$1@nnrp1.deja.com>

Last messages rec'd when compiling under aix 4.2.1 w gcc - tried all
other versions from 5.004_04 thru devel release of perl and received
same problem indication. not a programmer - where do I go from here ?
how do I fix it ?

/usr/local/include/cv.h: At top level:
/usr/local/include/cv.h:25: storage size of `xcv_xsubany' isn't known
make: The error code from the last command is 1.


Stop.
make: The error code from the last command is 2.


Stop.

rhapsody  /usr/local/src/perl/perl5.005_03:


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Thu, 15 Jul 1999 05:38:56 -0600
From: Joshua Harr <josh@titan.byu.edu>
Subject: regexp in substr?
Message-Id: <378DC850.D69CCF3F@titan.byu.edu>

I need to create a substring where the offset is dependent on a regular
expression.  The following won't work of course, but it may give a
better idea of what I am trying to do:

$E = substr($_,/-/);

so here, I want to return the substring of $_ from the first '-'
character to the end of the string.  Can anyone help me out here?  Much
thanks.



------------------------------

Date: Thu, 15 Jul 1999 14:53:25 -0400
From: evil Japh <jeffp@crusoe.net>
Subject: Re: regexp in substr?
Message-Id: <Pine.GSO.4.10.9907151452560.18698-100000@crusoe.crusoe.net>

> $E = substr($_,/-/);

A regex does NOT return the position.  perhaps you meant:

	substr($_, index($_, "-"));

-- 
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp

Crusoe Communications, Inc.
732-728-9800
www.crusoe.net



------------------------------

Date: Thu, 15 Jul 1999 13:06:36 -0500
From: mwkohout <mwkohout@csbsju.edu>
Subject: Re: script doesn't seem to be updating database....why?
Message-Id: <378E232C.556D5514@csbsju.edu>

This is a multi-part message in MIME format.
--------------5D434F4902AC1EE2A0EB2B4D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

 
 for the last couple of days, I've been trying to write a script that
would take an ID of a person, then pull their data out of the
database(based on that ID), put it into editable text fields, and then
when they are done editing the info, put the new data back into the
db(using the sql command UPDATE). 

 It's been going really badly.  It goes through all the motions, but
when
 I look at my db(mysql, by the way) through my frontend, nothing has
happened.
 
 any help in trying to get this to work would be great...
 thanks
 mike kohout
 -script is attached...
 

by the way, if you respond, it would be great if you could also send a
copy back to my email address, so I don't miss it in all the other pleas
for help out there :-)
--------------5D434F4902AC1EE2A0EB2B4D
Content-Type: application/x-perl;
 name="employeeedit1.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="employeeedit1.pl"

#!/usr/bin/perl -w

#packages needed
use DBI;
use CGI qw(:standard);
use CGI::Carp 'fatalsToBrowser';
use diagnostics;

#prepares web browser for html
print header;

#connect to the db...
$driver = "mysql";
$database="uptime";
$hostname="db.uptimecsi.com";
$port="3306";
$user="root";
$password="";
$dsn = "DBI:$driver:database=$database;host=$hostname;port=$port";
$dbh = DBI->connect($dsn, $user, $password) || die $dbh->errstr;


if (param('fname') ne "") {
    $fname=param('fname');
    $mname= param('mname');
    $lname=param('lname');
    $haddr1=param('address1');
    $haddr2=param('address2');
    $homephone=param('homephone');
    $cellphone= param('cellphone');
    $emailaddress=param('email');
    print "$emailaddress";

#the form has allready been filled out, needs now to be processed
    $emailaddress="'$emailaddress'";
    $preparing=$dbh->prepare("update employees 
        set fname=?, mname=?, lname=?, haddr1=?, haddr2=?, homephone=?, cellphonephone=? where email=?")
	|| die $dbh->errstr;

    $preparing->execute($fname,$mname,$lname, $haddr1, $haddr2, $homephone, $cellphone, $emailaddress) 
	||  die $dbh->errstr;
#    $preparing->execute()
#	                || die $dbh->errstr;  
   

$dbh->commit;
			print start_html("Input Sucessful!",'mwkohout@csbsju.edu');
    
}
elsif (param('email') ne "") {
#outputs current values, which the user can then modify or leave alone...
    $email=param('email');

#-------------------------------
#get and print out name... |
#-------------------------------
    $getname=$dbh->prepare("select fname,mname,lname from employees where email='$email'");
    $getname->execute();

    @name=$getname->fetchrow();
    ($fname, $mname,$lname)=@name;


#-------------------------------
#get and print out address1... |
#-------------------------------  
    $getaddr1=$dbh->prepare("select haddr1 from employees where email='$email'");
    $result=$getaddr1->execute();

    $addr1=$getaddr1->fetchrow();;


#-------------------------------
#get and print out email address... |
#-------------------------------  
    $getemail=$dbh->prepare("select email from employees where email='$email'");
    $result=$getemail->execute();

    $emailaddress=$getemail->fetchrow();
    param(-name=>'emailaddress', -value=>"$emailaddress");


#-------------------------------
#get and print out address2... |
#-------------------------------  
$getaddr2=$dbh->prepare("select haddr2 from employees where email='$email'");
$result=$getaddr2->execute();

$addr2=$getaddr2->fetchrow();;


#-------------------------------
#get and print out home phone... |
#-------------------------------  
$gethomephone=$dbh->prepare("select homephone from employees where email='$email'");
$result=$gethomephone->execute();

$homephone=$gethomephone->fetchrow();;

#-------------------------------
#get and print out cell phone... |
#-------------------------------  
$getcellphone=$dbh->prepare("select cellphonephone from employees where email='$email'");
$result=$getcellphone->execute();

$cellphone=$getcellphone->fetchrow();;


#-------------------------------
#get and print out hiredate... |
#-------------------------------  
$gethiredate=$dbh->prepare("select hiredate from employees where email='$email'");
$result=$gethiredate->execute();

$hiredate=$gethiredate->fetchrow();;

#------------------------------------------------------------
#get and print out vacation hours and sick hour remaining... |
#------------------------------------------------------------  
$getvacationhrsrem=$dbh->prepare("select vacationhrsrem  from employees where email='$email'");
$result=$getvacationhrsrem->execute();

$vacationhrsrem=$getvacationhrsrem->fetchrow();;

$getsickhrsrem=$dbh->prepare("select sickhrsrem  from employees where email='$email'");
$result=$getsickhrsrem->execute();

$sickhrsrem=$getsickhrsrem->fetchrow();;




    print start_html("Edit Employee Information",'mwkohout@csbsju.edu'), 
    start_form();
    param(-name=> 'email',  -value=>"$email");
    print q(First name:), textfield("fname","$fname");
    print "<br>",q(Middle Name:), textfield("mname","$mname");
    print "<br>",q(Last Name:), textfield("lname", "$lname");
    print "<br>", "Email Address: (non editable): $emailaddress";
    print hr, q(Cell Phone Number:), textfield("cellphone", "$cellphone");
    print "<br>" ,q(Home Phone Number:), textfield("homephone","$homephone");
    print hr, q(Home Address:),p, textfield("address1","$addr1",40), 
   	  p, textfield("address2","$addr2",40);
    print '<br>';
    print submit(-name=>'Input Data Into Database');
    print end_form, hr;

 
}
else  {
    
    print start_html("Enter ID of Employee to Edit",'mwkohout@csbsju.edu'), start_form();
    print "<br>Employee ID (email address):", textfield('email',"",'37');
    print end_form, hr;
}
 

    

    

--------------5D434F4902AC1EE2A0EB2B4D--



------------------------------

Date: Thu, 15 Jul 1999 18:45:36 GMT
From: grussell@hushmail.com (Gabriel Russell)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <37902c0a.182995353@news.supernews.com>

On Tue, 22 Jun 1999 02:20:31 -0500, rlb@intrinsix.ca (Lee) wrote:

>In article <slrn7mu48j.k1b.abigail@alexandra.delanet.com>,
>abigail@delanet.com (Abigail) wrote:
>
>>Bart Lateur (bart.lateur@skynet.be) wrote on MMCXX September MCMXCIII in
>><URL:news:376e9cd7.236836@news.skynet.be>:
>>II 
>>II Abigails quoting starts with one of:
>>II 
>>II  * 2 identical non-word characters (but not space)
>>II  * a set of matching "parens", such as "()","<>","[]","{}"
>>II  * Two capital i's. I've seen this only once, and honestly, I think this
>>II was a mistake.
>>
>>
>>Do you really think I make mistakes like that?
>
>Come, now, Abigail. You *are* human.
>
>Aren't you?
>
>Lee
>


Hmm, I can't see a single article by Abigail here on SuperNews.
Does she get filtered off some servers?


------------------------------

Date: 15 Jul 1999 13:13:24 -0400
From: jwjr@panix.com (James Wetterau)
Subject: Re: Test if a File Exists?
Message-Id: <7ml4rk$203$1@panix.com>

In article <378dcef8@cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, 
>    rjk@linguist.dartmouth.edu (Ronald J Kimball) writes:
>:> Phone your sysadmin and ask him to read out the manual for you.
>:> If there are 2 sysadmins in your MIS department, they can do it
>:> in stereo. With 3 or more, they can sing it in an ensemble.
>:
>:Oo, how about a round?
>
>A round?  A bloody *round*?  What do we need obsequious repetition
>for?

Well, I think that's the canonical way to do it.  Of course I agree to
the counterpoint that TIMTOWTDI.

Ducking,
James Wetterau




------------------------------

Date: Thu, 15 Jul 1999 17:13:53 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: Tiny error in perlfaq5
Message-Id: <379215b3.18040520@newshost.unx.sas.com>

On 15 Jul 1999 10:59:02 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>:The code $hits = int( (time() - 850_000_000) / rand(1_000) );
>:will occasionally generate a division by zero error.
>
>Either you don't know what rand(1_000) does, or else 
>you have a remarkably sparse notion of occasionally. :-)

rand(1000) will return a number in the range 0..999, so if rand is
truly random then approximately every thousand times the function is
called there will be a division by zero error.  There would be no
error with

int( (time() - 850_000_000 / ( rand(1_000) + 1 ) );

-- 
John Borwick


------------------------------

Date: 15 Jul 1999 14:16:49 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: Tiny error in perlfaq5
Message-Id: <a1pv1thj72.fsf@cyclone.jprc.com>

John.Borwick@sas.com (John Borwick) writes:

> >Either you don't know what rand(1_000) does, or else 
> >you have a remarkably sparse notion of occasionally. :-)
> 
> rand(1000) will return a number in the range 0..999, so if rand is
> truly random then approximately every thousand times the function is
> called there will be a division by zero error.  There would be no
> error with

$ perldoc -f rand

=item rand EXPR

=item rand

Returns a random fractional number greater than or equal to C<0> and less
than the value of EXPR.  (EXPR should be positive.)  If EXPR is
omitted, the value C<1> is used.  Automatically calls C<srand()> unless
C<srand()> has already been called.  See also C<srand()>.

(Note: If your rand function consistently returns numbers that are too
large or too small, then your version of Perl was probably compiled
with the wrong number of RANDBITS.)

(apparently Tom's first guess was correct.)

---Jason


------------------------------

Date: 15 Jul 1999 12:37:47 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Tiny error in perlfaq5
Message-Id: <378e2a7b@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    jobosw@unx.sas.com writes:
:rand(1000) will return a number in the range 0..999, so if rand is
:truly random then approximately every thousand times the function is
:called there will be a division by zero error.  There would be no
:error with

You say number, but you mean integer -- which is wrong.

    % perl -le 'print rand 1000'
    556.697226435975
    % perl -le 'print rand 1000'
    290.88636262259
    % perl -le 'print rand 1000'
    21.9218601278079
    % perl -le 'print rand 1000'
    525.976943391473
    % perl -le 'print rand 1000'
    413.803833377646

--tom
-- 
		Disco is to music what Etch-A-Sketch is to art.


------------------------------

Date: Thu, 15 Jul 1999 14:51:39 -0400
From: evil Japh <jeffp@crusoe.net>
Subject: Re: Tiny error in perlfaq5
Message-Id: <Pine.GSO.4.10.9907151451100.18698-100000@crusoe.crusoe.net>

> rand(1000) returns a floating point number $x such that 0 <= $x < 1000.
> The odds of this being precisely 0 are a lot more than 1/1000.

err, the odds are a lot LESS, meaning, less likely.  more would be more
likely.

-- 
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp

Crusoe Communications, Inc.
732-728-9800
www.crusoe.net



------------------------------

Date: 15 Jul 1999 11:53:04 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Tiny error in perlfaq5
Message-Id: <m1yaghpwxb.fsf@halfdome.holdit.com>

>>>>> "John" == John Borwick <John.Borwick@sas.com> writes:

John> rand(1000) will return a number in the range 0..999

Nope.  False premise.  ETOOMUCHBASIC :)

rand(1000) returns a floating point number $x such that 0 <= $x < 1000.

The odds of this being precisely 0 are a lot less than 1/1000.
Hint: 0.00001 is not 0.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Thu, 15 Jul 1999 13:16:54 -0700
From: "M.A. Henderson" <dchender@esn.net>
Subject: using ParseWords
Message-Id: <378E41B6.D566273C@esn.net>


I have just read a file into an array @lines.
The lines in the format:
     $variable = "younme@hitme.com  henshe@at.movies"

will this parse the addresses into a list?


use Text::ParseWords;
&parse_line(\, $keep, /x"[$lines[$count]]*"x/]);




------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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 V9 Issue 156
*************************************


home help back first fref pref prev next nref lref last post