[11127] in Perl-Users-Digest
Perl-Users Digest, Issue: 4726 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 22 22:06:41 1999
Date: Fri, 22 Jan 99 19:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 22 Jan 1999 Volume: 8 Number: 4726
Today's topics:
DBM problems with perl 5.005_2 on Alpha Linux koseph@dzone.co.kr
Re: debugging under WindowsNT <carvdawg@patriot.net>
Re: flock and cgi: can it hang? <bobm@cunix.com>
Handling an Empty Line bidyut@yahoo.com
Re: Handling an Empty Line (Matthew Bafford)
help?!: how to change a date to seconds since EPOCH (nospam)
Re: how to attach to an FPNW Machine <carvdawg@patriot.net>
Re: Is there a way to create self contained perl execut <tchrist@mox.perl.com>
Re: job hit counts, a mini unscientific survey (Randal L. Schwartz)
Re: MacPerl crashes when another process hogs the CPU f (Paul J. Schinder)
MSQL ordering-- derranged?? saul@umdnj.edu
Re: multi-dimensional arrays - more help please! scott.craig@moh.hnet.bc.ca
Perl and Databases <haiti@stc.com>
perl and databases <haiti@stc.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 23 Jan 1999 01:45:11 GMT
From: koseph@dzone.co.kr
Subject: DBM problems with perl 5.005_2 on Alpha Linux
Message-Id: <78b9j5$vi7$1@nnrp1.dejanews.com>
Hi, all.
I've compiled and installed the latest stable version of perl, 5.005_02 under
Alpha Linux. Through the 'make test', I've found that there are some problems
on testing lib/anydbm and lib/ndbm like this:
Failed Test Status Wstat Total Fail Failed List of failed
-----------------------------------------------------------------------------
-- lib/anydbm.t 12 6 50.00% 5-8, 10, 12 lib/ndbm.t 18 6 33.33% 5-8,
10, 12 2 tests skipped, plus 14 subtests skipped. Failed 2/186 test scripts,
98.92% okay. 12/6511 subtests failed, 99.82% okay.
Though all of the test results were not successful, I've installed the latest
version of perl. And I could install several perl modules without big
problems. The perl modules I've installed are as follwing as below:
PERLLOCAL(1) User Contributed Perl Documentation PERLLOCAL(1)
Thu Jan 21 14:14:40 1999: Module the IO-stringy manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.205
o EXE_FILES:
Thu Jan 21 14:16:27 1999: Module the MD5 manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.7
o EXE_FILES:
Thu Jan 21 14:17:59 1999: Module the HTML::Parser manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 2.20
o EXE_FILES:
Thu Jan 21 14:19:17 1999: Module the MIME::Base64 manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 2.06
o EXE_FILES:
Thu Jan 21 14:20:14 1999: Module the Mail manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.12
o EXE_FILES:
Thu Jan 21 14:20:46 1999: Module the Mail::POP3Client
manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.18
o EXE_FILES:
Thu Jan 21 14:22:25 1999: Module the Net manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.06
o EXE_FILES:
Thu Jan 21 14:24:33 1999: Module the libwww-perl manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 5.36
o EXE_FILES: bin/lwp-request bin/lwp-mirror bin/lwp-rget
bin/lwp-download
Thu Jan 21 14:25:55 1999: Module the LWPng-alpha manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 0.23
o EXE_FILES:
Thu Jan 21 14:27:24 1999: Module the MIME-tools manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 4.121
o EXE_FILES:
Thu Jan 21 14:28:26 1999: Module the DBI manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.06
o EXE_FILES: dbish dbiproxy
Thu Jan 21 14:30:35 1999: Module the WebFS::FileCopy
manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 0.03
o EXE_FILES:
Thu Jan 21 14:55:48 1999: Module the Msql-Mysql-modules
manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.2014
o EXE_FILES: dbimon
Thu Jan 21 14:57:10 1999: Module the Msql-Mysql-modules
manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.2014
o EXE_FILES: dbimon
Thu Jan 21 15:15:14 1999: Module the Msql-Mysql-modules
manpage
o installed into: /usr/lib/perl5/site_perl/5.005
o LINKTYPE: dynamic
o VERSION: 1.1825
o EXE_FILES: dbimon
Now, the problem is that my new perl goes wrong with some memory violation
errors when my own scripts are running. And reading on the dbm files is so
unstable. My dbm files were created on an old intel x86 machines. I've merely
copied them from the original harddisk that is used on intel box to a new
Alpha machine. Considered that there is a difference from the format of dbm
files, I've deleted all the old dbm files and recreated them through my own
perl scripts. After recreated the dbm files, I've found the file size of
newly created dbm files has been increased by more 2 times than the original
size. There is still a problem on reading the new dbm files. So difficult to
explain why, it doesn't always fail to read the dbm files. It occasionally
fails to read them, even it seems to corrupt the contents of dbm files.
I've heard that SDBM is the default DBM of perl and I've never used any "USE
anydbm" statement in my perl source. Seeing the result of 'make test', there
is no errors on SDBM. I don't know why and where the above problems come
from.
Is there anyone who experience the same situation like me? And is there any
way to troubleshoot it? Any helps will be greatly appreciated.
Regards,
Sung-Pyo Cho
koseph@cnetia.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 22 Jan 1999 20:42:21 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: debugging under WindowsNT
Message-Id: <36A8E2AD.DC35E92@patriot.net>
1. What does your script look like?
2. What does your PATH look like?
vbatorowicz@mmm.com wrote:
> Hi
> When I debug on Windows NT and I am not in the current directory I get the
> following message:
> E:\bin\New_stuff>
> E:\bin\New_stuff>testpo850.bat
> Can't locate perl5db.pl in @INC at e:\bin\New_Stuff\testmainarci.pl line 1.
> BEGIN failed--compilation aborted at e:\bin\New_Stuff\testmainarci.pl line 1.
> Please help.
> Thank you in advance
> Victor
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 22 Jan 1999 21:35:56 -0500
From: Bob Mariotti <bobm@cunix.com>
Subject: Re: flock and cgi: can it hang?
Message-Id: <36A9358B.BC93C9EF@cunix.com>
Having just implemented flock'ing in perl, my belief is that if one does not
explicitly unlock the file, terminating the perl program will automatically
unlock it.
joeltesttutor@my-dejanews.com wrote:
> I am setting up a DB_file to store data behind a website.
>
> What happens if a perl script locks a DB_file and then for whatever reason
> fails to close the file?
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 23 Jan 1999 01:34:28 GMT
From: bidyut@yahoo.com
Subject: Handling an Empty Line
Message-Id: <78b8v4$uqj$1@nnrp1.dejanews.com>
Hi there, I have one simple problem. I have a Perl progrma that reads a flat
file line by line and parse each line. I want the perl program to exit, if
the next line is empty or might have a carriage return. The program should
check if the line contains carriage return or basically an empty line.
Any help in this regard will be great!
Thanks in advance
Bidyut
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 23 Jan 1999 02:05:39 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Handling an Empty Line
Message-Id: <slrn7aibd0.1ok.dragons@Server.Network>
On Sat, 23 Jan 1999 01:34:28 GMT,
in article <<78b8v4$uqj$1@nnrp1.dejanews.com>>,
bidyut@yahoo.com <bidyut@yahoo.com> wrote:
=> Hi there, I have one simple problem. I have a Perl progrma that reads a flat
=> file line by line and parse each line. I want the perl program to exit, if
=> the next line is empty or might have a carriage return. The program should
=> check if the line contains carriage return or basically an empty line.
if ( $line =~ /^\s*$/ ) {
print "foo";
}
=> Any help in this regard will be great!
=> Thanks in advance
HTH!
=> Bidyut
--Matthew
------------------------------
Date: 23 Jan 1999 08:40:58 +1000
From: "Julian Kuiters" <j.kuiters@bigpond.com(nospam)>
Subject: help?!: how to change a date to seconds since EPOCH
Message-Id: <01be4658$29ccb320$4b4bd683@tbp.11519.Teletechintl.com>
Does anyone know the easiest way to convert a date back to seconds past
EPOCH?
thanx
Julian
------------------------------
Date: Fri, 22 Jan 1999 20:40:35 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: how to attach to an FPNW Machine
Message-Id: <36A8E243.5D22E3BE@patriot.net>
> I am trying to distribute a perl script that will run an executable from
> an NT machine running FPNW (File and Print Services for Netware). I need
> to map a drive to this machine as a particular user, send the password,
> and run a setup.exe from the mapped drive.
>
> Does anyone know how I can accomplish this?
>
> I have used open(HANDLE, "|net use ........ /USER:username, and I am
> trying to put the password into this handle's stdin, but am a little
> confused.
here's what I use...
# Do this after the username and password are chomped
open(NET, "net use x: ..... /user:$username $passwd |");
# Now run the command...using whatever method you choose
------------------------------
Date: 22 Jan 1999 19:41:36 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is there a way to create self contained perl executable?
Message-Id: <36a936e0@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
gjoshi@my-dejanews.com writes:
:Got to disagree with you here. If you are working in a customer oriented
:job it makes sense. When you send out some code to customers its good
:to give them a binary. This way they do not muck around with your code
:and change it beyond the point where you can fix it.
That's ridiculous. Have a little bit of respect for your customers,
and stop sticking them in strait-jackets. Apparently you missed Eric
Allman's keynote at LISA in Boston this past December.
Larry Wall has also addressed this: it's a red herring. He has never
gotten a bug report about something that was broken that was because
a user/customer had hacked up the code.
Back when we at Convex were shipping perl, shell, even some C programs
as source, we provided a tool that allows customer service to do a quick
MD5 checksum comparison on the standard versus the currently installed
versions of software. It was part of the standard bug-tracking and
diagnosing procedure to run a verify on a product installation. This
included checking for proper config files, installed bits, and checksums.
But the customers weren't crippled. Don't cripple your customers.
Don't consider them beneath you. Treat them like decent human beings,
not adversaries. Do unto them as you would have done unto you: that
means give them source code, of course.
--tom
--
Even if you do learn to speak correct English, whom are you going to
speak it to?
--Clarence Darrow
------------------------------
Date: 22 Jan 1999 18:05:50 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: job hit counts, a mini unscientific survey
Message-Id: <m1hftiiw01.fsf@halfdome.holdit.com>
>>>>> "Steve" == Steve Leibel <stevel@coastside.net> writes:
Steve> Might get even higher numbers by querying Solaris, HP/UX, BSD, and other
Steve> common variants.
Well, I wasn't aiming for "high numbers"... I was just doing
quick-n-dirty hit counts. For example, I should probably see how all
the Unix variants compare to all the Microsoft "operating systems"
(term used loosely :-).
I'm also thinking a graph of these numbers back over the history of
Dejanews would be interesting.
--
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: Fri, 22 Jan 1999 20:37:08 -0500
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: MacPerl crashes when another process hogs the CPU for too long
Message-Id: <schinder-2201992037080001@schinder.clark.net>
In article <36a8d23c.87730940@news.uswest.net>, psu22377@odin.cc.pdx.edu wrote:
} Running MacPerl 5.2.0r4 on a Power Mac G3 233 w/128Mb RAM, running
} MacOS
} 8.5
}
} I have a perl script that launches an application, then periodically
} checks to see if that launched process has exited. The application is
} standard ANSI C++, and so the way it runs on MacOS, the launched
} application does not yield back any processor time. The whole
} machine, including Perl, is essentially "frozen" while the launched
} application runs (MacPerl does not get any processor time, not even
} enough to update it's spinning cursor). When the application exits,
} MacPerl gets some processor time once again and continues to run the
} script.
}
} The problem comes if the application runs for upwards of an hour
} before exit. This means that basically MacPerl is suspended for about
} an hour. MacPerl crashes with a Type 1, Type 3 or a Type 11 error. Is
} there any reason why MacPerl, if "suspended" by another process
} hogging the CPU, would crash? I downloaded the source for MacPerl and
} looked around the main event loop. Is there anything with a call to
} sleep() that might result in a problem if perl was suspended then
} resume an several hours later?
}
} The perl script launches the C++ application in parallel with
} Mac::Processes, LaunchApplication. the process hash %Processes is
} used to check whether the application is running or not.
}
} the CPU, the more likely for MacPerl to crash when it finally gets
} some CPU time.
}
} the perl script had a while loop checking if the processes exited,
} with a call to sleep from perl (i.e. sleep 10;) before continuing in
} the while loop. Could the command sleep, if MacPerl were frozen in
} the middle of execution of a perl script's "sleep" for a few hours,
} would MacPerl possibly crash on regaining processor time?
}
} I was thinking that maybe there would be some kind of overflow problem
} if MacPerl was trying to return how many seconds were actually "slept"
} if it were frozen for a long time.
Two things come to mind, although neither may be the real problem. First,
are you sure your C++ application stays in it's own playpen? It may be
walking on MacPerl's memory while it's running. Second, are you sure
MacPerl has a big enough memory partition? If you use modules at all (and
you are), you need more than MacPerl is configured to ask for out of the
box. Until recently, I gave MacPerl 7.5 Mb, now I give it 30Mb. MacPerl
running out of memory isn't a pretty sight.
}
} thanks,
} Michael Ferrante <psu22377@odin.cc.pdx.edu>
}
}
--
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov
------------------------------
Date: Sat, 23 Jan 1999 02:20:19 GMT
From: saul@umdnj.edu
Subject: MSQL ordering-- derranged??
Message-Id: <78bbkt$16f$1@nnrp1.dejanews.com>
I am using MSQL to handle some relatively simple database tasks and am at a
complete loss in trying to get my results tables properly sorted. For a text
field the MSQL ORDER BY qualifier works fine but when sorting records by Date
fields or by _SEQ number the results seem essentially random. I access all
results tables through a hash refrence. Has anyone else experienced this sort
of difficulty?
J. Saul
saul@cyberenet.net
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 23 Jan 1999 01:59:12 GMT
From: scott.craig@moh.hnet.bc.ca
Subject: Re: multi-dimensional arrays - more help please!
Message-Id: <78badc$5f$1@nnrp1.dejanews.com>
In article <78a6bp$3hu$1@starburst.uk.insnet.net>,
"Chris" <c-denman@dircon.co.uk> wrote:
>
> I have loads of data files that I need to sort.
> =20
> Here is one data file:
> =20
> name:chris:
> age:27:
> sex:male:
> =20
> What I do, for easy access, is to load in the file and then turn it into =
> a hash array like so:
> =20
> open(FILE,"001.dat");
> @lines=3D<FILE>;
> close FILE;
> foreach $line (@lines){
> ($left,$right)=3Dsplit(/:/,$line);
> $DATA{$left}=3D$right;
> }
>
> I have a loop to do this for all the files, but what if I only want =
> cirtain files depending on their content like so:
> if($DATA{'age'}<20){
> $NEWARRAY[$counter++]=3D$DATA; # THIS LINE IS WRONG - HOW DO =
> I DO IT?
Only scalar values can be stored in arrays or hashes. References are
scalar values. So you could store them like so:
if( $DATA{age} < 20 {
$NEWARRAY[$counter++] = \%DATA;
}
Then to retrieve the items,
foreach $key ( keys %{$NEWARRAY[$counter++]} ){
print "$key = $NEWARRAY[$counter++]{$key}\n";
}
But why store the hashes in arrays at all?
if( $DATA{age} < 20 {
foreach $key ( keys %DATA ){
print "$key = $DATA{$key}\n";
}
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 22 Jan 1999 17:10:54 -0800
From: "ghost" <haiti@stc.com>
Subject: Perl and Databases
Message-Id: <78b7m5$256$1@giants.stc.com>
Hi this message is regarding a message that I posted earlier. My original
question delt with using cgi and perl on the Net to connect to an Access
database. With this in view I was advised to seek information on DBM::ODBC
or Win32::ODBC. Now however, after reading different messages that delt
with similar issues I find that my database choice may have been premature
as I see many people using mySQL, etc... Which database would be the best in
terms of ease of implimentation, use, efficiency, when it comes to
interfacing with the net? I would greatly appreciate any input general or
specific.
Thanks again
------------------------------
Date: Fri, 22 Jan 1999 17:14:16 -0800
From: "ghost" <haiti@stc.com>
Subject: perl and databases
Message-Id: <78b7si$2g4$1@giants.stc.com>
Hi this message is regarding a message that I posted earlier. My original
question delt with using cgi and perl on the Net to connect to an Access
database. With this in view I was advised to seek information on DBM::ODBC
or Win32::ODBC. Now however, after reading different messages that delt
with similar issues I find that my database choice may have been premature
as I see many people using mySQL, etc... Which database would be the best in
terms of ease of implimentation, use, efficiency, when it comes to
interfacing with the net? I would greatly appreciate any input general or
specific.
Thanks again
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4726
**************************************