[10189] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3782 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 22 04:07:15 1998

Date: Tue, 22 Sep 98 01:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Sep 1998     Volume: 8 Number: 3782

Today's topics:
    Re: Any Perl 5.005 binary build for win32? <Savage.Ron.RS@bhp.com.au>
    Re: cat reese > /dev/null (was Re: Perl & Java - differ (Abigail)
    Re: commented matching (Ronald J Kimball)
        comp.lang.perl.moderated available via e-mail <rra@stanford.edu>
    Re: even/odd numbers (Abigail)
    Re: I need a script writen, can someone help me please <rick.delaney@shaw.wave.ca>
    Re: Interesting method technique: Default $self (Larry Rosler)
    Re: JAPH: how does this .sig work? (Ronald J Kimball)
        multi expression unless statement? <dan@bns.com>
        perl & activeX?? (GEMINI)
    Re: Perl & Java - differences and uses (Jonathan Abbey)
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <bjohnsto_usa_net@my-dejanews.com>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <raj.subramani@citicorp.com>
    Re: Perl: Right Tool for the Job? <sfarrell@farrell.org>
    Re: Runtime evaluation of required modules (Ronald J Kimball)
        Square Root? <plasmoid@riname.com>
    Re: Square Root? <danboo@negia.net>
    Re: until problem (David A. Black)
        Value of RANDBITS from within perl? <b.d.low@unsw.edu.au>
    Re: Value of RANDBITS from within perl? <Toni.Erdmann@mch.sni.de>
    Re: where is Date::Parse? (Leslie Mikesell)
    Re: where is Date::Parse? (Honza Pazdziora)
        Win32::ODBC strange (?) error?! (Earthling)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 22 Sep 1998 04:21:13 GMT
From: "Ron Savage" <Savage.Ron.RS@bhp.com.au>
Subject: Re: Any Perl 5.005 binary build for win32?
Message-Id: <01bde5e0$eb1e2be0$87ea1286@steelres-pcm657.resmel.bhp.com.au>

I also get errors with internet etc. But -
I just found V 0.13 of libwin32 on CPAN. Here's hoping...
-- 
Ron Savage
Home (preferred): rpsavage@ozemail.com.au
Office: Savage.Ron.RS@bhp.com.au
http://www.ozemail.com.au/~rpsavage

[snip]
> I had the same problems with making perl 5.005_02. Currently, I am
> making perl 5.005 and tk800.008 with microsoft visual c++ 4.0 without
> any problems (even threads work). libwin32-0.12 builds after deleting
> the directories internet, ole and process (I have no time to find out
> why these don't compile and I don't need them). perl 5.005 only fails
 
[snip]



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

Date: 22 Sep 1998 03:28:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: cat reese > /dev/null (was Re: Perl & Java - differences and uses)
Message-Id: <6u75h4$evd$1@client3.news.psi.net>

Uri Guttman (uri@sysarch.com) wrote on MDCCCXLVIII September MCMXCIII in
<URL: news:x790jcx4wx.fsf_-_@sysarch.com>:
++ 
++
++ to sumarize, reese has no sense of humor, no sense of programming
++ history, no knowledge of turing machines and turing computability, a
++ narrow view of allowable syntax and semantics, a zealotic view on the
++ right way to do anything, in short, not a good candidate for perl.

Well, he does have a programming history. I've had the pleasure of
maintaining some of his code. 

Perfect examples of how not to code, and how to break any OO principle 
you can imagine.


Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


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

Date: Tue, 22 Sep 1998 01:48:24 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: commented matching
Message-Id: <1dfqg5n.1s7fdqnusudumN@bay2-509.quincy.ziplink.net>

Joe Spinney <jspin@csd.sgi.com> wrote:

> oops, I meant to put the 'x' flag at the end of the match pattern, not
> the 'm', but regardless it doesn't seem to work

It works fine for me.

Two points:

Copy and paste the sample code, don't retype it.  That will avoid
problems such as using 'm' when your actual code uses 'x'.  It will also
avoid problems where the sample code *does* work because of some subtle
difference from the real code.

Please be more explicit.  What do you mean by "it doesn't seem to work"?



~> cat > temp
$string = '    abcdX     ';

print "$1\n" if $string =~ m{
    ^\s+        # one or more leading spaces
    (\S+)X    # remember anything but spaces until 'X'
    \s+$    # followed by 1 or more spaces until the end
}x;
~> perl temp
abcd
~> 

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 21 Sep 1998 19:53:43 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: comp.lang.perl.moderated available via e-mail
Message-Id: <yl90jceu2w.fsf@windlord.stanford.edu>

This is a repeat of a previous announcement in comp.lang.perl.moderated
for the benefit of those people who may not have seen the first message or
whose ISPs may not be providing comp.lang.perl.moderated.

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 traffic on the mailing list will be the same as what is posted to the
newsgroup, and the submission address for the mailing list goes to the
submission address for the newsgroup.  This mailing list is therefore in
essence moderated via the same mechanism and with the same policies as the
newsgroup.

If there are any questions or problems, feel free to contact me.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 22 Sep 1998 03:31:52 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: even/odd numbers
Message-Id: <6u75n8$evd$2@client3.news.psi.net>

Leslie Mikesell (les@MCS.COM) wrote on MDCCCXLVIII September MCMXCIII in
<URL: news:6u7331$c96$1@Venus.mcs.net>:
++ 
++ The mind boggles at someone writing a computer program without
++ knowing that it works in binary or what the most basic binary
++ operations are.  Times change, I guess.


Maybe he is used to program in MIX, where you don't know whether
the architecture works in binary or decimal.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Tue, 22 Sep 1998 03:39:42 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: I need a script writen, can someone help me please
Message-Id: <36071D8E.B9809F74@shaw.wave.ca>

Gareth Hall wrote:
> 
> On Sat, 19 Sep 1998 10:42:03 -0500, tadmc@metronet.com (Tad McClellan)
> wrote:
> 
> >Gareth Hall (guruchoc@bigpond.com) wrote:
> >
> >: Can somone write a script for me.
> >
> >
> >   If you state how much the job pays you will likely get
> >   better responses to job offers...
> 
> It was just a freebie, no great brain power in this one, it's about 1k
> when finished, I have 90% of it done, just needs tweaking.
> 
> I didn't realise this was a pay me to write your script newsgroup,
> obviously I was mistaken, sorry.

Of course you can't get something for nothing.  

However, post the 10% of your code that you're having trouble with,
explaining what you expect, what you've tried and the part of the
docs/faq that you don't understand.

This kind of post will be payment enough for most people here.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Mon, 21 Sep 1998 20:20:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Interesting method technique: Default $self
Message-Id: <MPG.1070b757aa4ebb6e98987d@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6u0lk5$onh$1@monet.op.net> on 19 Sep 1998 12:20:21 -0400, 
Mark-Jason Dominus <mjd@Op.Net> says...
 ...
> This defeats the purpose of having DObj at all.  Maybe you meant to
> write this:
> 
> 	return $DObj || $DObj = $something->new;

I doubt that he meant to write that, because it doesn't compile.  Maybe 
you meant to write this:

  	return $DObj || ($DObj = $something->new);

:-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 22 Sep 1998 01:48:25 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: JAPH: how does this .sig work?
Message-Id: <1dfqgye.ik6uy0k26otqN@bay2-509.quincy.ziplink.net>

Matt Knecht <hex@voicenet.com> wrote:

> Arvind K. Karandikar <akarandi@pcocd2.intel.com> wrote:
> >perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
> >          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
> >          print chr 0x$& and q
> >          qq}*excess********}'
> 
> Using $* is very tricky, especially when combined with the *= operator
> and the noise of ****** which could be any string.

That's not noise.  That's ** ** **.  Or, to put it another way, the
typeglob ** raised to the power of the typeglob **.  In other words, 0
** 0, which evaluates to 1.  So, $*=****** is equivalent to $* = 1, and
$**=****** is equivalent to $* *= 1.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 21 Sep 1998 23:19:39 -0700
From: "Dan Bassett" <dan@bns.com>
Subject: multi expression unless statement?
Message-Id: <360740db.0@news1.starnetinc.com>

I have constructed a multiple expression unless statement like the
following:

unless ($in{'fname'} & $in{'lname'} & $in{'pass'}) {
print "test";
}

The above works just as it should.  It will print "test" if any one of the
$in variables is missing.

However, I am trying to make it work with the following:

unless ($in{'fname'} & $in{'lname'} & $in{'pass'} & $in{'page'} eq "1") {
print "test";
}

It says that it should print "test" if $in{'page'} DOES NOT equal "1".
However, it does not seem
to like it as it will print test if $in{'page'} DOES equal "1" and all of
the other variables are present
as well.

Is there something extra that I need to put in the $in{'page'} eq "1" to
make it work properly inside of
a multiple expression unless statement?

Any help would be appreciated...

Dan
dan@bns.com




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

Date: 22 Sep 1998 06:54:33 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: perl & activeX??
Message-Id: <6u7hj9$c0m$1@netnews.csie.NCTU.edu.tw>

hi all,
  There's a Win32::GUI module that can let us develop
GUI based AP on win32. however, I am wondering if there
is any way to use ActiveX controls (that are widely used in
VB & Web application) in our Perl script??
Thanks.



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

Date: 21 Sep 1998 21:58:06 -0500
From: broccol@arlut.utexas.edu (Jonathan Abbey)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6u73nu$r05@csdsun1.arlut.utexas.edu>

In article <6u1jf2$fev$1@godzilla.zeta.org.au>,
David Formosa <dformosa@zeta.org.au> wrote:
| 
| What happens when we reach the limmits of what OO can do well?  Sooner or
| later the next big paradine shift is going to come allong and unseat OO
| if your language locks you into the OO mode you are not going to be able
| to take advantage of this new wave in computer scince.

I'm gonna take a chance and throw a tidbit of possibly novel content
into this party.

Take a look at Tim Sweeney's UnrealScript, the actor/environment
language for Unreal.  It is modeled after Java, is object/class based,
but adds explicit language support for state-machine logic.  Methods
can be defined and overridden based on the state of the object as well
as the most-specific class of the object.  What's interesting about
this is the way that method resolution is performed, taking into
account both the current state classification and the class of an
object.  UnrealScript is not as novel as something like Icon, say, but
it seems to my relatively untutored eyes an elegant and attractive
linguistic synthesis.  And it extends the OO model to handle more
dynamic changes nicely.

You can find the reference at http://unreal.epicgames.com/UnrealScript.htm.

Okay, that's it for novelty. :-) Now for (more) sheer raw opinion and
some obvious observations.

OO certainly has limits.  It has an overhead cost, both in runtime
cycles and in programmer time with regards to having to erect some
scaffolding that may not buy anything in small programs.  It doesn't
naturally fit all problem domains, and one can certainly imagine
linguistic (and extra-linguistic) mechanisms that will enhance the OO
model.

But I'll go out on a limb and argue that we're not likely to see an
'unseating' of object orientation for 'complex system' programming, no
more than we have seen structured programming unseated.  OO is just
too powerful a paradigm for modeling the world and its inherent
complexities.  That's why Perl has object oriented linguistic
features, after all, right?  I can imagine artificial intelligence
systems that might significantly transcend the object as the
predominant programming focus, but our own cognitive systems are too
grounded in the game of classes of things and behavior of things to
believe that object orientation will not be a major part of
programming from here on out, in some form or another.  (Then again,
is the Internet object-oriented?)

George Reese has taken a *lot* of flames here for being a bit too
rah-rah-rah for object oriented programming, but a lot of what I
imagine he has been trying to convey has genuine merit.  It is harder
to build large programs without the discipline that object orientation
imposes.  It is certainly true that just because a language like Perl
lets you write in slang and idiom doesn't mean that you can't also
write very tightly organized, structured, and object oriented code.  I
know a fellow who is working on a team developing and maintaining a
code base of over 130,000 lines of object oriented Perl.  They seem
quite happy with it.

Personally, I'm more comfortable writing large, complex code systems
with Java than with Perl.  Perl's many great features make it easy to
write powerful small programs.  Java's relatively rigid adherence to a
class structure is a genuine feature that makes it easier to write
powerful large programs.  It may be that I am simply not a good enough
programmer to keep object oriented discipline when I code in Perl, but
I think it's also true that languages influence one's thinking, and
that it is easier to think about hashes and strings in Perl than it is
to think about objects and classes.  I certainly believe that novice
programmers encountering Java for the first time will pick up how to
use classes and objects far more quickly than the novice programmer
meeting Perl for the first time.  I've been doing rather a lot of Perl
for about 6 years now, and I have to confess I am still hazy about how
classes and references and all the rest really work in Perl.  Of
course, after 150,000 lines of Java, I'm still unclear as to how to do
regular expressions in it. :-)

Like I said, a bunch of obvious observations and sheer raw opinion.
George "bete noire" Reese should read some of Larry's books and Perl
Conference presentations, but I don't think he's as hopeless as all
that.  How many programmers in the wide world do know how to define
an algorithm, anyway? ;->

-- 
-------------------------------------------------------------------------------
Jonathan Abbey				              jonabbey@arlut.utexas.edu
Applied Research Laboratories                 The University of Texas at Austin
-------------------------------------------------------------------------------


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

Date: 22 Sep 1998 04:32:03 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906438708.595721@thrush.omix.com>

George Reese <borg@imaginary.com> wrote:
	>snip<
: If you would like a bit of irony, however, I
: believe my book was one of O'Reilly's best selling titles at last year's
: Perl conference.  I believe it was number 3 behind the NT book and the Java
: in a Nutshell second edition.
	>snip<

	Hmm, interesting, your Java/JDBC book right?  You'd never have guessed
	it from most of the reviews from readers at Amazon:

	"I have programmed in Java for sometime, but have not used JDBC.
	 This book really didn't help me accomplish that goal."

	"The book is more about three tier client/server and RMI than it is
	 about fully useful database programming using JDBC and JAVA."

	"I found this book hard to follow and the sample code was to big to
	 learn from."

	Even most of the "good" reviews knock the book:

	"Maybe JDBC itself does not have enough interesting content, the
	 author spent much effort to explore multiple tier computing model
	 and RMI instead."

	"To this effect, the book is quite thin. You should not expect this
	 book to help you much in JDBC trouble-shooting."

	To George's credit, there were a couple other "good" reviews. 
	However, the bad comments far outweighed the good.

	http://www.amazon.com/exec/obidos/ASIN/1565922700/qid%3D906437853/002-2147147-3309216

	Funny, I used to think ORA held much higher standards for there
	authors and work... :-/

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 22 Sep 1998 05:02:02 GMT
From: "bjohnsto_usa_net" <bjohnsto_usa_net@my-dejanews.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <01bde5e6$35a53460$2c16b3d1@lhodgkiss>

Zenin <zenin@bawdycaste.org> wrote in article
<906425568.616328@thrush.omix.com>...
> bjohnsto_usa_net@my-dejanews.com wrote:
> 	>snip<
> : Python is also implemented on top a Java Virtual Machine with, I
presume, no
> : C,
> 
> 	Who told you such lies?  Python's core is completely in C.

I think that JVM is an increasingly important platform.

As Java gets a decent cross platform GUI, and a safe, fast, solid,
widespread  system to run foreign code popular platforms, like Perl, will
have to have the ability run in and produce the Java Virtual Machine
assembler too.

> -Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:

Brendan Johnston



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

Date: 22 Sep 98 06:16:55 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906445285.800391@thrush.omix.com>

bjohnsto_usa_net <bjohnsto_usa_net@my-dejanews.com> wrote:
: I think that JVM is an increasingly important platform.
	>snip<

	I think the *idea* of an open source, language independent,
	platform independent, byte code format is important.  The Java
	byte code is likely too closely tied to Java for this to really
	happen.  My understanding is that Java byte code can't do lambda
	style functions for instance, thus making things like a Java
	byte code backend for Perl and other languages that much harder,
	if not impossible.  Maybe a perl written in Java, but that's
	completely different.

: As Java gets a decent cross platform GUI, and a safe, fast, solid,
: widespread system to run foreign code popular platforms, like Perl, will
: have to have the ability run in and produce the Java Virtual Machine
: assembler too.

	Maybe, we'll see.  Java is on the right track, mostly.  I'm really
	waiting for the Java world to wake up and realize they aren't
	everything, and that *language* independence is just as important as
	platform independence.  I'm a little tired of RMI, the Serializable
	format, and similar "Java only" systems with not so much as even the
	format spec to try to connect to them from another language.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Tue, 22 Sep 1998 08:57:14 +0100
From: Raj Subramani <raj.subramani@citicorp.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <3607585A.46D0D6BC@citicorp.com>

Here's my 2p worth which will also help keep this eternal thread
eternal.

I was tasked with a small job of developing an installer for a piece of
Client-Server based software that gets deployed over eight locations
world-wide. The task involves killing processes, sucking data across the
network and copying files between locations (mostly UNIX based
commands).

I wrote the whole thing in Perl5 in about 3 weeks. It has taken me a
while to get the ftp sockets completely sorted in Java and I still have
to figure out Telnet and other system command executions within Java. I
felt that the Perl5 modules with Telnet, Ftp and Term classes was
extremely useful in reducing development times. However I am not a very
keen Tk fan and hence the GUI bit is lacking.

The Java GUI is of course quite good but most RAD tools today come with
very good built-in Net modules which offers good competition.

I suppose I shall remian an enthusiastic sceptic of Java for a while
yet.

Cheers
---
-raj


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

Date: Tue, 22 Sep 1998 03:55:11 GMT
From: stephen farrell <sfarrell@farrell.org>
Subject: Re: Perl: Right Tool for the Job?
Message-Id: <87g1dkls2o.fsf@couatl.uchicago.edu>

rick@marinweb.com (Rick Freeman) writes:

> So, am I crazy thinking of trying to do this with a Perl script?

Did you look into glimpse and webglimpse?  I"m sure you can do this
with perl, but why re-invent the wheel?

--sf


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

Date: Tue, 22 Sep 1998 01:48:27 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Runtime evaluation of required modules
Message-Id: <1dfqhx1.1iztjz6iotp9gN@bay2-509.quincy.ziplink.net>

Andy Marden <amarden@ibm.net> wrote:

> But even then the require caused the contents of the module to be
> evaluated at compile time, which is what I want to avoid.

Nope, require is a run-time directive.

BEGIN {}, however, denotes a block of code which is run at compile time.
So, if you want to load a module at run-time, use the require statement,
and don't put it in a BEGIN block.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 22 Sep 1998 04:46:40 GMT
From: Mark Robinson <plasmoid@riname.com>
Subject: Square Root?
Message-Id: <36072BA4.95EFFDF3@riname.com>

Is there a function that does a square root?  Is it sqrt?


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

Date: Tue, 22 Sep 1998 02:05:53 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Square Root?
Message-Id: <36073E41.9D2D8BC7@negia.net>

Mark Robinson wrote:
> 
> Is there a function that does a square root?  Is it sqrt?

not to pick on anyone, but these questions always amaze me. i admit
to assuming that you have access to perl, and that may be incorrect,
but if you do have access, then testing this is trivial:

perl -e 'print sqrt 16'

not to mention the fact that it's listed in perlfunc.

and to answer the questions... yes and yes!

cheers,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Mon, 21 Sep 1998 17:31:30 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: until problem
Message-Id: <6u6gji$jov$1@earth.superlink.net>

Hello -

"Robert F. Soto" <rfs@castillian.com> writes:

>Can anyone tell me why this does not work:

>until (chomp($s = <STDIN>) eq 'q') {print("$s\n");}

>When $s eq 'q' it still prints.


chomp() returns the number of characters removed, which is very likely
to be 1 in your example.  Therefore, you're comparing 1 and q.

You could do what you're trying to do with this:

until ( chomp ($s = <STDIN>), $s eq 'q' ) { print "$s\n" }

though it feels unidiomatic.


David Black
dblack@saturn.superlink.net


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

Date: Tue, 22 Sep 1998 16:49:54 +1000
From: Benjamin Low <b.d.low@unsw.edu.au>
Subject: Value of RANDBITS from within perl?
Message-Id: <36074892.C89CC2DA@unsw.edu.au>

(How) can I find the value of RANDBITS from within a perl script?
(short of processing a `$^X -V` call :-)

The context is within a key generating routine, where I'd like the key
to be as big and random as possible, without resorting to encrypting
/dev/proc or using any modules. I'm using

$k = rand(1<<$randbits);

and I'd like to warn if RANDBITS is "too small".

(I've read the FAQs, Prog Perl and searched Dejanews)


Any comments appreciated!


-- 
 Benjamin Low, BEng (Elec)
 Communications Unit, University of New South Wales, Australia
 (02) 9385 1138  b.d.low@unsw.edu.au  b.d.low@ieee.org


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

Date: Tue, 22 Sep 1998 09:12:45 +0200
From: Toni Erdmann <Toni.Erdmann@mch.sni.de>
Subject: Re: Value of RANDBITS from within perl?
Message-Id: <36074DED.602DA8EF@mch.sni.de>

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

Hi Benjamin,

See the script: 't/op/rand.t' (this comes along with perl5.*.tar.gz).
This Test-Script checks the RANDBITS (I guess).

Ciao
Toni

Benjamin Low wrote:

> (How) can I find the value of RANDBITS from within a perl script?
> (short of processing a `$^X -V` call :-)
>
> The context is within a key generating routine, where I'd like the key
> to be as big and random as possible, without resorting to encrypting
> /dev/proc or using any modules. I'm using
>
> $k = rand(1<<$randbits);
>
> and I'd like to warn if RANDBITS is "too small".
>
> (I've read the FAQs, Prog Perl and searched Dejanews)
>
> Any comments appreciated!
>
> --
>  Benjamin Low, BEng (Elec)
>  Communications Unit, University of New South Wales, Australia
>  (02) 9385 1138  b.d.low@unsw.edu.au  b.d.low@ieee.org



--------------7F6D5AF5506619D0639E5BFF
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Erdmann, Antonius
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Antonius Erdmann
n:              Erdmann;Antonius
org:            SNI OEC XS COM ISDN
adr;dom:        ;;Otto-Hahn-Ring 6;Muenchen;Germany;D-81730;
email;internet: Toni.Erdmann@mch.sni.de
tel;work:       +49.89.636-47711
tel;fax:        +49.89.636-47655
tel;home:       +49.89.6094219
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------7F6D5AF5506619D0639E5BFF--



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

Date: 21 Sep 1998 22:00:15 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: where is Date::Parse?
Message-Id: <6u73rv$cdj$1@Venus.mcs.net>

In article <6u6lsi$7dg$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>Honza Pazdziora (adelton@fi.muni.cz) wrote on MDCCCXLVII September
>MCMXCIII in <URL: news:slrn70de85.o6k.adelton@aisa.fi.muni.cz>:
>++ On 21 Sep 1998 16:39:47 GMT, Abigail <abigail@fnx.com> wrote:
>++ > 
>++ > It's just a plain stupid and dumb piece of code. To frustrating
>++ > to work with. 
>++ 
>++ Why don't you just offer patches? Or have you got a complete new
>++ piece of code that allows at least the same functions as CPAN.pm
>++ does?
>
>
>*ponder*
>
>What functionality is in CPAN you can't get with "ftp", "tar", "zcat",
>"less", "make", and basic reading skills?

About umpteen thousand less keystrokes to install a reasonable set
of modules...  And I don't see any other way to find what CPAN's 
'r' command tells you unless you really like exercising those
reading skills by checking all your version numbers against the
CPAN directory yourself.

I had many of the same problems you did with the initial setup, but
only on systems behind a filewall where ftp either needed a proxy
or passive mode.  Did you perhaps have ftp/lynx/ncftp configured
to work under your own user id, but switch to root to run CPAN?

  Les Mikesell
    les@mcs.com


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

Date: Tue, 22 Sep 1998 07:15:19 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: where is Date::Parse?
Message-Id: <slrn70ejk7.a9a.adelton@aisa.fi.muni.cz>

On 21 Sep 1998 23:01:38 GMT, Abigail <abigail@fnx.com> wrote:
> 
> What functionality is in CPAN you can't get with "ftp", "tar", "zcat",
> "less", "make", and basic reading skills?

$ perl -MCPAN -e shell
cpan> r

It really *saves* a time administering multiple platforms. Even if
I have CPAN mirror on local LAN, NFS mounted, the indexing support
CPAN.pm provides is great. Of course, you can get the functionality
slowly and with more keystrokes but life is too short for this kind of
heroism.

I regulary check for new versions of modules my users need and install
them. Usually once you installed the module, you know that the
upgrades will be without problems and can just run install on them.
And for other cases, you have look.

If your only alternative to CPAN.pm are ftp/tar/zcat/less/make -- sorry,
I don't buy this.

Yours,

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


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

Date: Tue, 22 Sep 1998 06:36:46 GMT
From: erthling@nospamihug.co.nz (Earthling)
Subject: Win32::ODBC strange (?) error?!
Message-Id: <36074255.371490575@192.168.1.2>

Gidday folks,

	I am new to Perl and have decided rather than learning Perl by
using the useless little programs you see all over the Web (hello
world, if's, regex stuff etc), I would take a larger task on and see
if I can't get it to work.

	What I am trying to do is access an ODBC database (Access 97)
using the Win32:ODBC interface.  I have successfully set up the
datasource, I can connect to it and toss simple SQL commands at it..
All appears to work beautifully.  One thing I have been trying to get
to work is the TableList() function to work properly.  

	I went to the page of the guy who wrote the ODBC modules for
Perl to see if I could find out what I needed.  It suggests that once
I have connected to the datasource, I should be able to do the
following:

my(@tables) = $db->TableList;

	This command on its own produces an error in the odbc module:

Use of Unitialized value at C:\Perl\5.00502\lib/Win32/ODBC.pm

	This appears, I would be guessing, for each of the tables
which are in the database.  I am trying to take a list of tables from
an external file, check to see if they are in my database already, if
they are, ignore them, if not, then add them.  I have tracked the
culprit down to this command (with a lot of commenting out parts of
code).  The funny thing is that the rest of the code works alright, it
just outputs piles of errors and gets me nervous ;-)  plus, its
supposed to be outputting to the screen what it is doing, and it just
doesn't look nice..  At all...  

	If anyone has got any ideas about it, please contact me at
erthling@ihug.co.nz.   I am sure this is not the first time it has
popped up, and I don't think I am doing anything wrong with it, nor
can I find any more detailed information about it at various web sites
all over so I need some help.  

					Regards,
						Scott


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

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

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