[10478] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4067 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 26 12:27:46 1998

Date: Mon, 26 Oct 98 09:00:58 -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           Mon, 26 Oct 1998     Volume: 8 Number: 4067

Today's topics:
    Re: *Why* does clpm attract non-perl posts? <ljz@asfast.com>
    Re: *Why* does clpm attract non-perl posts? <ljz@asfast.com>
        [help me] oracle dbi problem hooni26@my-dejanews.com
        [OFF TOPIC] Should I use GPL or The Artistic ? (Koos Pol)
    Re: [OFF TOPIC] Should I use GPL or The Artistic ? <garethr@cre.canon.co.uk>
    Re: a question of scope (Greg Bacon)
    Re: Any Chicago Perl Mongers Group? (David Adler)
    Re: Any Chicago Perl Mongers Group? <eashton@bbnplanet.com>
        any interest? script searches registry (Bob N.)
        Broken rand() and srand() on perl5.005 ?? <etienne@anonimo.isr.ist.utl.pt>
    Re: Broken rand() and srand() on perl5.005 ?? <m.v.wilson@erols.com>
    Re: Broken rand() and srand() on perl5.005 ?? (Martien Verbruggen)
    Re: Broken rand() and srand() on perl5.005 ?? (Sam Holden)
    Re: Broken rand() and srand() on perl5.005 ?? <etienne@anonimo.isr.ist.utl.pt>
    Re: comp.lang.perl.win32 [again] jbharvey@auspex.net
    Re: comp.lang.perl.win32?? (Anita M Wilcox)
    Re: Connecting to Oracle on Unix using Win32::ODBC (Anita M Wilcox)
        Date compare routine <support@counter.w-dt.com>
    Re: Date compare routine (Steffen Beyer)
    Re: Date compare routine <cynical@iname.com>
    Re: Date compare routine (clay irving)
    Re: Date compare routine <support@counter.w-dt.com>
    Re: Date compare routine (John Moreno)
    Re: Date compare routine (John Moreno)
    Re: deadlock with flock() and open() (Honza Pazdziora)
    Re: deadlock with flock() and open() <sugalskd@netserve.ous.edu>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 26 Oct 1998 00:11:52 -500
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <ltzpajj49z.fsf@asfast.com>

> [ ... ]
>
> Lloyd Zusman <ljz@asfast.com> writes:
> 
> >There will always be novices coming here, and many of them, being
> >novices in the first place, are going to be unaware of netiquette and
> >c.l.p.misc conventions.  [ ... ]
> 
> Of course there is a range of cases and experiences, but I've definitely
> seen/read defenses of the posing of CGI and other non-Perl or
> para-Perl questions in clpm.

I've seen a few of these also, now and then.  Most of the time, however,
I see people posting off-topic questions, being corrected, and then
disappearing, presumably to the appropriate newsgroups.

> Besides, it comes back to the original question: all else being equal,
> why don't people interested in X find their way to newsgroups about
> X?  (Ummm, that's X as in a variable, not X as in X :-)
> 
> Any argument that can be made about why CGI questions end up in clpm
> *should* apply to such questions ending up in comp...cgi.  Perhaps
> the spillover is less than I think, as a percentage of all such
> posters.  It's certainly strikingly high as a percentage of clpm
> posters.

I agree that this is a strikingly high percentage, and then I ask
myself why.  Here are some hypothetical reasons I came up with and
considered:

(1)  The people who post CGI questions to c.l.p.misc are deliberately
     doing so to harass the rest of the people who like to post
     to c.l.p.misc ... they then laugh maniacally behind their
     newsreader screens when they see the indignant reactions that
     they know they will provoke among the c.l.p.misc regulars.

(2)  The people who post CGI questions to c.l.p.misc are hard-headed
     and stubborn, and so they persist on posting off-topic questions
     to their own detriment, even though they know better.

(3)  Most people who post to usenet these days, especially people
     who are "newbies", are lazy freeloaders who love to sponge off
     of others.  They hate the idea of doing any kind of original
     thinking, and if they had their way, they'd bring every
     country in the world to its knees through their active,
     almost religious aversion to personal initiative ... sort of
     like what happened to the U.S. in Ayn Rand's "Atlas Shrugged".
     These people know that they can't rely on each other to
     get their questions answered, since none of them have done
     any original thinking and none of them therefore *have* any
     answers.  And so, they go to one of the few, remaining places
     where original thinkers and initiative-takers reside: 
     c.l.p.misc.  They believe they deserve to be spoon-fed
     information without expending effort, and therefore, they
     expect the John-Galt-like giants of competence and
     individualism in c.l.p.misc to answer any and all of their
     questions about *anything*, including off-topic items like
     CGI, etc.

(4)  The people who post CGI questions to c.l.p.misc do so because
     they are usenet novices, and because almost all the CGI programs
     at their site are written in Perl, and Perl has the reputation
     for being a very good language for writing CGI scripts. They
     therefore mistakenly assume that CGI and Perl are somehow
     synonymous, or at least tightly coupled, and so being usenet
     novices, the first place they think of going to is the Perl
     newsgroup.  Furthermore, the fact the Perl newsgroup name begins
     with "comp.lang." and the CGI newsgroup names begin with
     "comp.infosystems." make it even more likely that people will
     come across the Perl newsgroup before learning of the existence
     of the CGI newsgroups (who even has a clue what the
     "comp.infosystems." hierarchy is all about until someone else
     explains that web-related stuff falls under the category of
     "infosystems"?).

After a suitable amount of deliberation, I rejected reasons 1, 2, and
3, and I settled on number 4 as the most likely case, by far.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -le '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x"'


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

Date: 26 Oct 1998 11:06:31 -500
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <ltn26js3y0.fsf@asfast.com>

nvp@shore.net (Nathan V. Patwardhan) writes:

> Lloyd Zusman (ljz@asfast.com) wrote:
> : c.l.p.misc conventions.  The fact that the number of novices doesn't
> : seem to be significantly decreasing says a lot more about Perl's
> : quality, usefulness, and popularity than anything about some sort of
> : fallaciously-imagined "reluctance" on the part of these novices to
> : take their questions elsewhere.
> 
> I agree with this.  Too bad that beginners or first-timers were also
> angry when they perceived Tom's "welcome to Perl" message (auto-FAQ)
> as some kind of spam.  FWIW, I found that document to be pretty
> helpful.

Which beginners and first-timers are you referring to?  Only very
rarely do I see someone complaining about the auto-FAQ here.  I think
that this must be a miniscule percentage of all the people who receive
this auto-posting.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -le '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x"'


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

Date: Mon, 26 Oct 1998 08:13:33 GMT
From: hooni26@my-dejanews.com
Subject: [help me] oracle dbi problem
Message-Id: <711avd$gvr$1@nnrp1.dejanews.com>





my os is win98
oracle DBI install problem 2

perl makefile.pl  <--- ok

nmake  <enter>  <--- problem
 .
 .
 .
cp lib/DBI/FAQ.pm blib\lib\DBI\FAQ.pm
cp lib/DBI/ProxyServer.pm blib\lib\DBI\ProxyServer.pm
cp lib/DBD/Proxy.pm blib\lib\DBD\Proxy.pm
cp DBIXS.h blib\arch\auto\DBI/DBIXS.h
cp dbd_xsh.h blib\arch\auto\DBI/dbd_xsh.h
cp dbi_sql.h blib\arch\auto\DBI/dbi_sql.h
cp lib/DBD/NullP.pm blib\lib\DBD\NullP.pm
cp lib/DBD/Sponge.pm blib\lib\DBD\Sponge.pm
cp lib/DBI/Format.pm blib\lib\DBI\Format.pm
cp lib/DBI/DBD.pm blib\lib\DBI\DBD.pm
cp Driver.xst blib\arch\auto\DBI/Driver.xst
cp DBI.pm blib\lib\DBI.pm
cp DriverDB.xst blib\arch\auto\DBI/DriverDB.xst
C:\PERL\5~1.005\BIN\MSWIN3~1\PERL.EXE
-IC:\Perl\5.00502\lib\MSWin32-x86- object -IC:\Perl\5.00502\lib
C:\Perl\5.00502\lib\ExtUtils/xsubpp -object_capi  - typemap
C:\Perl\5.00502\lib\ExtUtils\typemap DBI.xs >DBI.tc && C:\PERL\5~1.005\B
IN\MSWIN3~1\PERL.EXE -IC:\Perl\5.00502\lib\MSWin32-x86-object
-IC:\Perl\5.00502\ lib -MExtUtils::Command -e mv DBI.tc DBI.c Usage: xsubpp
[-v] [-C++] [-except] [-prototypes] [-noversioncheck] [-nolinenumb ers] [-s
pattern] [-typemap typemap]... file.xs NMAKE : fatal error U1077:
'C:\PERL\5~1.005\BIN\MSWIN3~1\PERL.EXE' : return code  '0xff' Stop.



NMAKE : fatal error U1077: 'C:\PERL\5~1.005\BIN\MSWIN3~1\PERL.EXE' : return
code  '0xff' Stop.  <--- problem


help me !!!!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 26 Oct 1998 13:02:57 GMT
From: koos_pol@nl.compuware.com.NO_JUNK_MAIL (Koos Pol)
Subject: [OFF TOPIC] Should I use GPL or The Artistic ?
Message-Id: <711ru1$gce@news.nl.compuware.com>


I want to release a Perl script soon in the spirit of Open Source. Are there
good reasons why I shoud choose the GPL or the Artistic License ?
(For the sake of argument: "...under the same license as Perl..." is no
reason). After reading the licenses carefully, most significant
difference is that the Artistic license seems less strict.

I couldn't find comparing threads in gnu.discuss.misc. Also in clpm, the
only relevant thread I could find was on licensing documentation.

-- 
Koos Pol
----------------------------------------------------------------------
S.C. Pol - Systems Administrator - Compuware Europe B.V. - Amsterdam
T:+31 20 3116122   F:+31 20 3116200   E:koos_pol@nl.compuware.com

Check my email address when you hit "Reply".


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

Date: Mon, 26 Oct 1998 13:33:22 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: [OFF TOPIC] Should I use GPL or The Artistic ?
Message-Id: <sizpaje9ct.fsf@cre.canon.co.uk>

Koos Pol <koos_pol@nl.compuware.com.NO_JUNK_MAIL> wrote:
> I want to release a Perl script soon in the spirit of Open Source. Are there
> good reasons why I shoud choose the GPL or the Artistic License ?
> (For the sake of argument: "...under the same license as Perl..." is no
> reason). After reading the licenses carefully, most significant
> difference is that the Artistic license seems less strict.

Your choice depends on the freedom you want to grant to people to use
your software.  The GPL is somewhat restrictive: it requires anyone
incorporating GPL'd code into their product to release their entire
product under the GPL (and with source code, too).  The Perl licence
gives more freedom to people to bundle Perl with commercial products.

So it depends whether you think *all* software should be free, or
whether you think that it's up to the author.

You might look at the LGPL (GNU library licence) for another option.

-- 
Gareth Rees


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

Date: 26 Oct 1998 15:11:16 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: a question of scope
Message-Id: <7123ek$q8u$4@info.uah.edu>

In article <MPG.109abeebd9cf340d9898db@nntp.hpl.hp.com>,
	lr@hpl.hp.com (Larry Rosler) writes:
: In article <3630BA11.718D82E8@harris.com> on Fri, 23 Oct 1998 13:17:05 -
: 0400, PERL ROCKS! <emills@harris.com> says...
: > ...  How does one pass a hash as a reference to a sub,
: > along with other values? For example:
[snip example]
: 
:      my %h = %{$_[2]};
: 
: should work.

Keep in mind that this is a local copy.  Changes made in %h won't
propogate back to the caller (unless the sub returns %h, but that
seems pretty wasteful).

Greg
-- 
A meeting is an event at which the minutes are kept and the hours are lost.


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

Date: 26 Oct 1998 06:42:11 GMT
From: dha@panix.com (David Adler)
Subject: Re: Any Chicago Perl Mongers Group?
Message-Id: <7115k3$d2m@news1.panix.com>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
>Jim Allenspach wrote:
>
>>         http://chicago.pm.org/
>
>"Donuts and dancing girls at every meeting?" Really? I must get the
>stl.pm guys to join me some night to drive up and join y'all. :) This
>could be fun. I'm laughing just thinking of the possibilities.

Yeah, but you gotta come to NYC for the dancing Chihuahuas!

>Beware. MarsNeedsWomen.pm is coming soon to a .pm near you. Be Afraid. 

I *am* afraid... I've seen the movie.  Eek!  Bad doesn't begin to
describe it...

I do, of course, have a copy of the video.

masochistically, dave

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Que?" - Manuel


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

Date: Mon, 26 Oct 1998 16:03:55 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Any Chicago Perl Mongers Group?
Message-Id: <36349ADC.8747DDD@bbnplanet.com>

David Adler wrote:

> Yeah, but you gotta come to NYC for the dancing Chihuahuas!

Hmmm. Add a bottle of Highland Park to that and it sounds much better
than dancing girls with donuts :)

> >Beware. MarsNeedsWomen.pm is coming soon to a .pm near you. Be Afraid.
> 
> I *am* afraid... I've seen the movie.  Eek!  Bad doesn't begin to
> describe it...

:) Well, we're serious, of course. We are getting a group together for
women in Perl. MarsNeedsWomen seems a propos. We will be making a formal
announcement as soon as we get the mailing list together.

> I do, of course, have a copy of the video.

Watch it, you may even get the joke. *hee*

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: 26 Oct 1998 02:52:40 GMT
From: bobn@interaccess.com (Bob N.)
Subject: any interest? script searches registry
Message-Id: <710o5o$qpu$1@supernews.com>

I'm thinking of uploading the script described below to the scripts area
on CPAN.  This is a script, not a module.  Part of the process is
discussing this in various places t guage interest and avoid reinventing
the wheel.

Any interest?  Comments invited.

- Bob N.

 On Sat, Oct 24, 1998 at 02:07:59AM -0500, Bobn wrote:
> I'd like to submit a script I call reg.pl.
>
> It runs on winNT and Win95, uses Tk to provide a gui, allows user to
> recursivley search the registry, starting at user-selected point(s) in
> the tree, and matching against the keys and values using Perl's regular
> expressions.  Output is in a Text window which can be editted and saved.



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

Date: 25 Oct 1998 22:19:58 +0000
From: Etienne Grossmann <etienne@anonimo.isr.ist.utl.pt>
Subject: Broken rand() and srand() on perl5.005 ??
Message-Id: <87lnm4gu7l.fsf@anonimo.isr.ist.utl.pt>


   Hello,

   Sorry if the issue has already been treated (I can't access the
perlfaq on the web, for some reason) ...

   Are rand() and srand() broken on perl5.005 ?  I have tried
repeatedly doing : 
  
# perl -we 'foreach (1..8){printf("%3f ",rand())}; print "\n"'

   and :

# perl -we 'srand(time());foreach (1..8){printf("%3f ",rand())}; print "\n"'


   and various other combinations, but the output sequence is invariably :

0.463662 0.848942 0.495977 0.291053 0.180421 0.684178 0.727550 0.139058 



  Etienne
 

======================================================================


Summary of my perl5 (5.0 patchlevel 5 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.0.34, archname=i586-linux
    uname='linux anonimo 2.0.34 #3 tue jul 21 09:15:28 west 1998 i586 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Jul 24 1998 21:43:55
  @INC:
    /usr/lib/perl5/5.005/i586-linux
    /usr/lib/perl5/5.005
    /usr/lib/perl5/site_perl/5.005/i586-linux
    /usr/lib/perl5/site_perl/5.005
    .


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

Date: Mon, 26 Oct 1998 02:26:50 +0000
From: WMWilson <m.v.wilson@erols.com>
Subject: Re: Broken rand() and srand() on perl5.005 ??
Message-Id: <3633DDEA.3260AC7@erols.com>

Etienne Grossmann wrote:
> 
>    Hello,
> 
>    Sorry if the issue has already been treated (I can't access the
> perlfaq on the web, for some reason) ...
> 
>    Are rand() and srand() broken on perl5.005 ?  I have tried
> repeatedly doing :
> 
> # perl -we 'foreach (1..8){printf("%3f ",rand())}; print "\n"'
> 
>    and :
> 
> # perl -we 'srand(time());foreach (1..8){printf("%3f ",rand())}; print "\n"'
> 
>    and various other combinations, but the output sequence is invariably :
> 
> 0.463662 0.848942 0.495977 0.291053 0.180421 0.684178 0.727550 0.139058
> 
>   Etienne
> 
> 
Now this one I know.  With rand(), you have to provide a maximum number
or by default the "random number" will be between 0 and 1. 

Example: perl -we 'srand(time());foreach (1..8){printf("%3f
",rand(6,000))}; print "\n"'

Here's man perlfunc

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


-- 
		\||/
		(..)
    +---oOOo-----(_)-----oOOo-----+
    | mailto:m.v.wilson@erols.com |
    |	       WMWilson	  	  |
    |__USCS Data Center Sysadmin__|


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

Date: Mon, 26 Oct 1998 02:13:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Broken rand() and srand() on perl5.005 ??
Message-Id: <NUQY1.40$4V4.203277@nsw.nnrp.telstra.net>

In article <3633DDEA.3260AC7@erols.com>,
	WMWilson <m.v.wilson@erols.com> writes:
> Etienne Grossmann wrote:
>>
>>    Are rand() and srand() broken on perl5.005 ?  I have tried
>> repeatedly doing :
[snip]
>>    and various other combinations, but the output sequence is invariably :
>> 
>> 0.463662 0.848942 0.495977 0.291053 0.180421 0.684178 0.727550 0.139058
>> 
> Now this one I know.  With rand(), you have to provide a maximum number
> or by default the "random number" will be between 0 and 1. 

Euhmm... I think that Etienne knows this. I believe that his question
was not "How do I get rand to return numbers outside of the range of 0
- 1?", and I really don't see how you got that idea.

I think the question is "Why doesn't the seeding of my random number
generator seem to fail? perl 5.005 and Linux."

To add more than just help in interpreting the question:

On SunOS 5.6, perl 5.004_04, 5.005, 5.005_02, rand works just fine. I
don't know what went wrong with Etienne's installation on Linux, but
the problem doesn't seem to be a general perl issue. Calling srand
shouldn't make any difference, because rand() calls srand on first
use, unless it already has been called.

Maybe the Linux libraries are broken? What happens if you use rand(3)
from a c program? It sort of looks like either srand doesn't do
anything, or it never gets called. In the latter case, it might be a
perl problem, but then just one for the Linux version.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 26 Oct 1998 03:17:40 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Broken rand() and srand() on perl5.005 ??
Message-Id: <slrn737qek.1kg.sholden@pgrad.cs.usyd.edu.au>

On Mon, 26 Oct 1998 02:13:01 GMT, Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>In article <3633DDEA.3260AC7@erols.com>,
>	WMWilson <m.v.wilson@erols.com> writes:
>> Etienne Grossmann wrote:
>>>
>>>    Are rand() and srand() broken on perl5.005 ?  I have tried
>>> repeatedly doing :
>[snip]
>>>    and various other combinations, but the output sequence is invariably :
>>> 
>>> 0.463662 0.848942 0.495977 0.291053 0.180421 0.684178 0.727550 0.139058
>>> 
<snip>
>To add more than just help in interpreting the question:
>
>On SunOS 5.6, perl 5.004_04, 5.005, 5.005_02, rand works just fine.

Rand works fine under perl 5.005_02 on my linux box. So I'm guessing it's
a broken c library or a broken perl install...

<snip>

-- 
Sam

Can you sum up plan 9 in layman's terms? It does everything Unix does
only less reliably.
	--Ken Thompson


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

Date: 26 Oct 1998 08:04:18 +0000
From: Etienne Grossmann <etienne@anonimo.isr.ist.utl.pt>
Subject: Re: Broken rand() and srand() on perl5.005 ??
Message-Id: <87iuh7hhq5.fsf@anonimo.isr.ist.utl.pt>

sholden@pgrad.cs.usyd.edu.au (Sam Holden) writes:

  Hello

> >>>    Are rand() and srand() broken on perl5.005 ?  I have tried
> >>> repeatedly doing :
 
> Rand works fine under perl 5.005_02 on my linux box. So I'm guessing it's
> a broken c library or a broken perl install...
> 


   Thank, I should check that. *Some* rand seems to work, though (that
of "octave" works). I should check my Perl installation.

  Thanks again,

  Etienne


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

Date: Sun, 25 Oct 1998 23:09:33 GMT
From: jbharvey@auspex.net
Subject: Re: comp.lang.perl.win32 [again]
Message-Id: <710b3d$f7p$1@nnrp1.dejanews.com>

Let's do it, I'm in.  Have you gotten a favorable response Daniel?


In article <m3n26l3cmp.fsf@rand.dimensional.com>,
  Daniel Grisinger <dgris@rand.dimensional.com> wrote:
> Would anyone interested in helping write an RFD for
> comp.lang.perl.win32 please contact me (via e-mail,
> not on clpm; we don't really need to clog clpm with
> this).
>
> dgris
> --
> Daniel Grisinger          dgris@rand.dimensional.com
> Supporter of grumpiness where grumpiness is due on clpm.
> perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 26 Oct 1998 13:33:55 GMT
From: amw@world.std.com (Anita M Wilcox)
Subject: Re: comp.lang.perl.win32??
Message-Id: <F1FsCK.JCA@world.std.com>

 ...STUFF DELETED
>> I really don't see that much OS prejudice in clpm (with a few loud-mouthed
>> exceptions).
>
>Unfortunately, that's all it takes!
>Even though I personally think Windows is a miserable excuse for an
>operating system, I support the notion that Win32 programmers
>ought to have a forum in which "NT Sucks!" is considered a troll.
>

Too true.  Some of us prefer Unix but don't always have the say
in OS.  I'm a consultant who has started to see more and more
NT-based businesses who want Perl.  I'm at a point where I may
actually have to by an NT-specific book (ugh!) just to reference the 
differences. So, not all people who use Windoze platforms are
newbies, they may just be stuck with that platform :-)

Anita



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

Date: Mon, 26 Oct 1998 13:22:58 GMT
From: amw@world.std.com (Anita M Wilcox)
Subject: Re: Connecting to Oracle on Unix using Win32::ODBC
Message-Id: <F1FruA.DG4@world.std.com>

In article <6vtfbq$nna$1@nnrp1.dejanews.com>,
 <broker2000@my-dejanews.com> wrote:
>Hi,
>
>I am running PERL v5.0004 on WinNT. I am trying to write a script that will
>connect to an Oracle server on Unix. I am trying to use the Win32:ODBC module
>to accomplish this.

I had the same problem.  Try this:

# define the database 'names'
$dsn = "dd";
$uid = "request";
$pwd = "request";
$service = "rusty.world";
$connect_string = "DSN=$dsn;DBQ=$service;UID=$uid;PWD=$pwd";

# this is the connection to the request database
$db = new Win32::ODBC($connect_string);


Works like a charm.  This is connecting to Oracle from NT
to another NT box, but it shouldn't matter.  Just fill in
your info and go!

Anita



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

Date: Mon, 26 Oct 1998 00:16:11 -0600
From: Mike <support@counter.w-dt.com>
Subject: Date compare routine
Message-Id: <363413AB.B46FC53D@counter.w-dt.com>

Is their a date comparision routine out their some where that is simple
and easy to use to compare two dates? If so can you please post the
address. I have looked an all I can find is routines that give out the
time and date and don't compare them. Thanks.



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

Date: 26 Oct 1998 12:42:12 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: Date compare routine
Message-Id: <711qn4$9e1$1@en1.engelschall.com>

Mike <support@counter.w-dt.com> wrote:

> Is their a date comparision routine out their some where that is simple
> and easy to use to compare two dates? If so can you please post the
> address. I have looked an all I can find is routines that give out the
> time and date and don't compare them. Thanks.

You can either convert the dates to seconds since the epoch and
compare these numbers directly (see "perldoc localtime"), or use
Perl modules for this, for instance Date::Manip or Date::Calc,
available from

http://www.perl.com/CPAN/modules/by-module/Date/

HTH.

Yours,
-- 
    Steffen Beyer <sb@engelschall.com>
    Free Perl and C Software for Download: www.engelschall.com/u/sb/download/


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

Date: Mon, 26 Oct 1998 12:13:20 +0000
From: Jordan Conley <cynical@iname.com>
Subject: Re: Date compare routine
Message-Id: <36346760.50D98F0D@iname.com>

Mike wrote:
> 
> Is their a date comparision routine out their some where that is simple
> and easy to use to compare two dates? If so can you please post the
> address. I have looked an all I can find is routines that give out the
> time and date and don't compare them. Thanks.

go to www.cpan.org and download the Date::DateCalc Module. This will do
all you need.

Jordan

-- 
"In the beginning the Universe was created. This has made
many people very angry and has been widely regarded as a
bad move."
-Douglas Adams, Hitchhikers Guide to the Galaxy


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

Date: 26 Oct 1998 09:18:55 -0500
From: clay@panix.com (clay irving)
Subject: Re: Date compare routine
Message-Id: <7120cf$7fq@panix.com>

In <363413AB.B46FC53D@counter.w-dt.com> Mike <support@counter.w-dt.com> writes:

>Is their a date comparision routine out their some where that is simple
>and easy to use to compare two dates? If so can you please post the
>address. I have looked an all I can find is routines that give out the
>time and date and don't compare them. Thanks.

Did you look at the Date/Time section of Perl Reference? 
http://reference.perl.com/

Something like this from Date::Calc --

  $days = dates_difference($year1,$mm1,$dd1,$year2,$mm2,$dd2);

    This function calculates the difference in days between the two
    given dates.

    The function calculates the difference "date 2" - "date 1",
    i.e., you normally specify the two dates in chronological order.

    If date 1 is later than date 2, the result will be negative,
    which allows you to use this function to compare dates.

    If one of the two dates is invalid, the result will degrade to
    the value of the function "calc_days()" for the other date
    (possibly negative). If both dates are invalid, the result is
    zero.

    It is the user's responsibility to make sure that both dates are
    valid (use "check_date()" for this)!

Or something like this from Date:Manip --

      $date1=&ParseDate($string1); 
      $date2=&ParseDate($string2); 
      if ($date1 lt $date2) { 
            # date1 is earlier
      } else { 
            # date2 is earlier (or the two dates are identical)
      }


-- 
clay irving
clay@panix.com
http://www.panix.com/~clay/


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

Date: Mon, 26 Oct 1998 09:09:11 -0600
From: Mike <support@counter.w-dt.com>
Subject: Re: Date compare routine
Message-Id: <36349097.5810BACC@counter.w-dt.com>

I don't want some big long module, I just want to know a short snipplet that will
tell me if one date is after another.

clay irving wrote:

> In <363413AB.B46FC53D@counter.w-dt.com> Mike <support@counter.w-dt.com> writes:
>
> >Is their a date comparision routine out their some where that is simple
> >and easy to use to compare two dates? If so can you please post the
> >address. I have looked an all I can find is routines that give out the
> >time and date and don't compare them. Thanks.
>
> Did you look at the Date/Time section of Perl Reference?
> http://reference.perl.com/
>
> Something like this from Date::Calc --
>
>   $days = dates_difference($year1,$mm1,$dd1,$year2,$mm2,$dd2);
>
>     This function calculates the difference in days between the two
>     given dates.
>
>     The function calculates the difference "date 2" - "date 1",
>     i.e., you normally specify the two dates in chronological order.
>
>     If date 1 is later than date 2, the result will be negative,
>     which allows you to use this function to compare dates.
>
>     If one of the two dates is invalid, the result will degrade to
>     the value of the function "calc_days()" for the other date
>     (possibly negative). If both dates are invalid, the result is
>     zero.
>
>     It is the user's responsibility to make sure that both dates are
>     valid (use "check_date()" for this)!
>
> Or something like this from Date:Manip --
>
>       $date1=&ParseDate($string1);
>       $date2=&ParseDate($string2);
>       if ($date1 lt $date2) {
>             # date1 is earlier
>       } else {
>             # date2 is earlier (or the two dates are identical)
>       }
>
> --
> clay irving
> clay@panix.com
> http://www.panix.com/~clay/



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

Date: Mon, 26 Oct 1998 10:21:34 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Date compare routine
Message-Id: <1dhi3ro.1r6k2iq1ud6lowN@roxboro0-032.dyn.interpath.net>

Mike <support@counter.w-dt.com> wrote:

> Is their a date comparision routine out their some where that is simple
> and easy to use to compare two dates? If so can you please post the
> address. I have looked an all I can find is routines that give out the
> time and date and don't compare them. Thanks.

What kind of comparisons are you looking to do and what format is the
date in?

-- 
John Moreno


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

Date: Mon, 26 Oct 1998 10:54:17 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Date compare routine
Message-Id: <1dhi54g.1udun38kttnt8N@roxboro0-032.dyn.interpath.net>

Mike <support@counter.w-dt.com> wrote:

> I don't want some big long module, I just want to know a short snipplet
> that will tell me if one date is after another.

-snip-

Next time put your reply BELOW what you are quoting and then snip liberally.

As for telling if one date is after another

$then=time;
sleep 5;
$now=time;

print '$now is after $then' if $now>$then;

-- 
John Moreno


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

Date: Sun, 25 Oct 1998 20:55:08 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: deadlock with flock() and open()
Message-Id: <slrn73741c.bac.adelton@aisa.fi.muni.cz>

On 23 Oct 1998 17:42:40 GMT, John Reynolds <reynolds@kcc.nospam.com> wrote:
> 
> If they both execute at the same time they can both end up waiting on the
> other to release the lock on their respective files.
> 
> Is there a way to test to see if a file is locked before trying open()?

You can do a non blocking lock, that would return immediately with
error if it cannot lock the file. Then, you can release all your
previous lock, have some timeout (sleep) and try again.

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 26 Oct 1998 03:03:32 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: deadlock with flock() and open()
Message-Id: <710oq4$dru$1@news.NERO.NET>

Russ Allbery <rra@stanford.edu> wrote:
: One of the proposals you tend to hear from theoretical OS design circles
: is to have the operating system mediate all of the locks and do the
: circular dependency checking itself; in other words, if process X locks
: file A and then tries to lock file B, and process Y locks file B and then
: tries to lock file A, the operating system would detect that X and Y are
: waiting on locks held by each other and the lock attempt in both X and Y
: would fail with a "deadlock broken" error.

: The argument in favor of having the operating system do this is that
: detecting deadlocks requires global state knowledge (in other words,
: knowing about everything that's running on the system, not just the
: resources of any one process), which implies that one should at least
: consider moving it up into the OS.

Having worked with an OS that does this (VMS), I can say that it makes
things much nicer froma program design perspective. You don't have to
worry about jumping through all sorts of hoops to make sure you lock
things in proper order, or build your own deadlock breakers and suchlike
stuff. Just check the retrun code and leave it at that. (It's the thing I
hate the most about POSIX threads--deadlocking mutexes stay deadlocked
forever. Bleah)

Moving the locking up to the OS level also allows you to expand the scope
of locks more. VMS, for example, implements a distributed lock
manager--all the machines in a cluster talk to one another and coordinate
locks, so if a program on cluster member A locks a file, a program on
cluster member Q will block trying to acces sit. (Try *that* with most NFS
implementations)

You also can abstract things out some, and have general-purpose locks that
don't actually tie to anything in particular, yet still have the
properties of a lock. Process A on cluster member C creates a lock object,
and all processes on all the other cluster members can get, check, or
release the lock. (Which is actually how the VMS lock manager works. The
filesystem code uses the abstract locks to implement file and record
locking)

It's useful for failover systems--start up a service on all the cluster
nodes, but onky the first will aquire the lock and service the requests.
If it fails for some reason (machine crash, aplication error, whatever),
the lock is released and the next process gets it, taking up the slack.
Combined with async lock requests, which allow a process to ask for a
request then go about its business until tits notified the lock is
available, you've got a very powerful tool for building 24x7 systems.
(Plus you get to have fun watching Oracle struggle to re-implement the VMS
lock manager on all the non-VMS systems that it runs on, but that's sucha
petty pleasure... :)

Lock services are *definitely* something that should be implemented by the
OS. It's the only way to make sure they're done consistently, if not
actually correctly.

					Dan


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 4067
**************************************

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