[11746] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5346 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 9 22:07:29 1999

Date: Fri, 9 Apr 99 19:00:18 -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           Fri, 9 Apr 1999     Volume: 8 Number: 5346

Today's topics:
    Re: Can you use defined() on a typeglob? (M.J.T. Guy)
    Re: Don't you have to work? <gellyfish@gellyfish.com>
    Re: Don't you have to work? <jeromeo@atrieva.com>
    Re: Don't you have to work? <grichard@uci.edu>
    Re: Don't you have to work? <mpersico@erols.com>
    Re: here docs vs qq quote operator. Just personal prefe <mpersico@erols.com>
        How Do I Declare A Hash Without Errors? (Danny Chang)
    Re: How Do I Declare A Hash Without Errors? (Larry Rosler)
    Re: How Do I Declare A Hash Without Errors? <jeromeo@atrieva.com>
    Re: How Do I Declare A Hash Without Errors? (Sam Holden)
    Re: How Do I Declare A Hash Without Errors? (Danny Chang)
    Re: How Do I Declare A Hash Without Errors? <mpersico@erols.com>
    Re: How do I grab a page on the net using sockets? <pkkc@btinternet.com>
    Re: Insecure dependency in system ... (Sam Holden)
    Re: MQ Series, C/C++, UNIX, Windows NT -- Southern Cali <jglascoe@giss.nasa.gov>
        MQ Series,C/C++,UNIX,Windows NT -- Southern California  karynelk@my-dejanews.com
        regarding anonymous subroutines, and typeglobs (Corey Saltiel)
    Re: Regex with lookahead help <jimbox@lucent.com>
    Re: RTFM please!  perldoc PSI::ESP (was Re: Validating  <mpersico@erols.com>
    Re: SORT BY DATE <mpersico@erols.com>
    Re: SORT BY DATE <APTavistock@lbl.gov>
    Re: Sys::Syslog (Neil Cherry)
    Re: Thank You comp.lang.perl.misc! <mpersico@erols.com>
        Threads problem (Vince Busam)
    Re: Trouble with DBI and Oracle <nospam_earnold@requisite.com>
    Re: Y2K (yes, again - sorry!) <mpersico@erols.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 9 Apr 1999 23:57:15 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Can you use defined() on a typeglob?
Message-Id: <7em44r$ofo$1@pegasus.csx.cam.ac.uk>

Daniel Beckham <danbeck@qual.net> wrote:
>I need to check to see if a filehandle is defined.  Can I use a defined() o a 
>typeglob?

There isn't a concept of "defined" for a filehandle in Perl.

Perhaps you mean "Is this filehandle currently open?".   In which case
see   perldoc -f fileno.


Mike Guy


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

Date: 9 Apr 1999 23:40:51 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Don't you have to work?
Message-Id: <7em363$23v$1@gellyfish.btinternet.com>

On Fri, 9 Apr 1999 14:32:10 -0700 Larry Rosler wrote:
> In article <7elnel$gpo@news.service.uci.edu> on Fri, 9 Apr 1999 13:24:15 
> -0700, Gabriel Richards <grichard@uci.edu> says...
>> Disclaimer: This is not a criticism.
> 
> Perhaps not.  But it may be a troll.
>  
>> Some particularly helpful people in this newsgroup seem to get a word in on
>> virtually every question posted.
> 
> As the most frequent poster in the most recent period (60 between 29 Mar 
> and 05 Apr), perhaps I should respond.  DejaNews reports 58000 total 
> articles during that time, which seems way too high.  (Can anyone 
> explain that?  My guess is about 1000 messages on a weekday.)  But 
> whatever the real number is, 'virtually every question' seems like a 
> slight overstatement.
> 

At this I had a quick review of the Statistics postings over the last few
months and there does seem to a pattern here doesnt there ... 

Actually until February I never posted from work at all - evenings,weekends
etc and still seemed to post quite a lot. I now *do* post from work but
I dont spend a lot of time with that really (you can tell the ones from
work 'cause they dont have the .sig :).

I think its like a self perpetuating thing once you've started doing it.

I, like other 'top-tenners', like to see things well answered or sometimes
like to fool around - I mean I've only met half a dozen of the people who
have *ever* posted to this group but it feels like I know the lot of them
and sometimes it feels like a pub, albeit one with a limited topic of
conversation.

Anyhow time for for Tad to confess now I think ;-}

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 09 Apr 1999 16:45:04 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Don't you have to work?
Message-Id: <370E9100.1499BEBD@atrieva.com>

Larry Rosler wrote:

> It's tempting to give you the 'New York' answer -- MYOFB -- but then I
> wouldn't have responded at all.

Indeed.  The Seattle version is --- *Please* MYOFB ---  ;->


-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Fri, 9 Apr 1999 17:02:13 -0700
From: "Gabriel Richards" <grichard@uci.edu>
Subject: Re: Don't you have to work?
Message-Id: <7em47b$n6d@news.service.uci.edu>

Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.117811b1d9d7251a989882@nntp.hpl.hp.com...
> In article <7elnel$gpo@news.service.uci.edu> on Fri, 9 Apr 1999 13:24:15
> -0700, Gabriel Richards <grichard@uci.edu> says...
> > Disclaimer: This is not a criticism.
>
> Perhaps not.  But it may be a troll.
>

Please don't misinterpret. I've already benefitted from your expertise and I
wouldn't have it any other way. I find the process of reading just a portion
(let alone a majority) of these posts time consuming (and sometimes
hopelessly annoying). I've noticed that you and a few others seem to
consistently respond to everyone's questions. I've wondered why you and the
others bother.

I'm just interested in the computer communitiy in general. They're a
different breed in many respects.

Gabe




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

Date: Fri, 09 Apr 1999 21:33:51 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Don't you have to work?
Message-Id: <370EAA7F.6396A541@erols.com>

Gabriel Richards wrote:
> I've wondered why you and the
> others bother.

Because Larry (and if you need a last name, you don't belong here) may have created a computer language, but through his personal 'aura' also fostered a COMMUNITY. Larry was (is?) a linguist, not a computer scientist. He was not the typical heads-down coder. He freely shared his knowledge, took great pains to do so. His personality was fetching and it was a break from the usual geek-oid sterotypical behaviors (See billg@microsoft.com)

Plus the fact that his linguist bent made for MTOWTDI some of which are just kick ass cool.

Anyway, we have a community here. I happen to be one of the many unheralded citizens therein, but I belong none the less. There are more heralded people who share their knowledge. I chime in every once in a while. It's unfortunate that contribution with no material compensation should be such a unbelievable concept, but there it is.

As an aside, you may think it funny to "belong" you belong to a comminuty where you've never met 99% of the inhabitants. But then again, do I know at least 1% of the inhabitants of the USA? I don't think so.

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Fri, 09 Apr 1999 21:20:05 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: here docs vs qq quote operator. Just personal preference?
Message-Id: <370EA745.7BB7B23E@erols.com>

Lee wrote:
> 
> tadmc@metronet.com (Tad McClellan) wrote:
> 
> >Uri Guttman (uri@home.sysarch.com) wrote:
> >
> >: here docs are called that because of their ancestry from sh. there they
> >: were documents that were 'here' and not in a file, that were fed into
> >: stdin. perl uses them as alternative string quotes and should use a
> >: different name. i have seen word/line delimited/quoted strings. any
> >: ideas on a better term for them?
> >
> >
> >   "there docs"?
> >
> >[...]
> >
> >   "multi-line quotes/docs"
> >
> >[...]
> >
> >   I think working "quote" into the name would help conceptually.
> 
> multiline here/there quote-strings.
> 
> Naming conventions by committee.
> 
> Lee

<sharp whistle> Here docs, here here docs, come here boy! C'mon! Good boy!
-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: 9 Apr 1999 18:11:03 -0500
From: danny@see.the.message (Danny Chang)
Subject: How Do I Declare A Hash Without Errors?
Message-Id: <370e871c.81032153@news3.newscene.com>

I'm using use strict and -w and I get 'Use of uninitialized value'
errors at the points in my code where I'm assigned hash elements, such
as:

$hash{$hash_element} = value;

I tried declaring the hash prior to the assignment as:

my $hash={};

I found that the hash and the hash element can't be declared as:

my $hash{$hash_element} = value;

Is there any way to eliminate the 'Use of uninitialized value' warning
messages?

Thanks for any help.

Danny Chang
dannychang@heartmind.org


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

Date: Fri, 9 Apr 1999 16:55:35 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How Do I Declare A Hash Without Errors?
Message-Id: <MPG.11783354bece2281989883@nntp.hpl.hp.com>

In article <370e871c.81032153@news3.newscene.com> on 9 Apr 1999 18:11:03 
-0500, Danny Chang <danny@see.the.message> says...
> I'm using use strict and -w and I get 'Use of uninitialized value'
> errors at the points in my code where I'm assigned hash elements, such
> as:
> 
> $hash{$hash_element} = value;

This tries to assign the bareword 'value' to the hash %hash with key 
$hash_element.  Using 'use strict;', this will generate a compile-time 
error.

> I tried declaring the hash prior to the assignment as:
> 
> my $hash={};

This declares a scalar '$hash' and initializes it to refer to an empty 
anonymous hash.  This variable has no relationship to the hash '%hash' 
that is being used in the first statement above.

> I found that the hash and the hash element can't be declared as:
> 
> my $hash{$hash_element} = value;

Correct.  'my' can be used only on scalars and entire aggregates (arrays 
and hashes), not on their members.

> Is there any way to eliminate the 'Use of uninitialized value' warning
> messages?

This is where confusion sets in.  The declarations are required by 'use 
strict;' and errors are generated at compile time.  The 'uninitialized 
value' warnings are generated at run time.

The only problem I can think of is that $hash_element is undefined, or 
the scalar expression called 'value' (that you haven't shown us) being 
assigned to that key is undefined.  Try printing each of them 
separately.

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


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

Date: Fri, 09 Apr 1999 16:48:19 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: dannychang@heartmind.org
Subject: Re: How Do I Declare A Hash Without Errors?
Message-Id: <370E91C3.F6DF04FD@atrieva.com>

Danny Chang wrote:

> I tried declaring the hash prior to the assignment as:
> 
> my $hash={};

This declares $hash a reference to a hash.

Try 

my %hash=();

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: 9 Apr 1999 23:55:45 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How Do I Declare A Hash Without Errors?
Message-Id: <slrn7gt4s1.c30.sholden@pgrad.cs.usyd.edu.au>

On 9 Apr 1999 18:11:03 -0500, Danny Chang <danny@see.the.message> wrote:
>I'm using use strict and -w and I get 'Use of uninitialized value'
>errors at the points in my code where I'm assigned hash elements, such
>as:
>
>$hash{$hash_element} = value;
>
>I tried declaring the hash prior to the assignment as:
>
>my $hash={};

That's a reference to a hash stored in $hash. Completely different
from %hash.

You will need 'my %hash' or 'use vars qw(%hash <other vars>)'
in order to pass the the strict.

>
>I found that the hash and the hash element can't be declared as:
>
>my $hash{$hash_element} = value;
>
>Is there any way to eliminate the 'Use of uninitialized value' warning
>messages?

Make sure that $hash_element is defined before using it as a 
key in the hash.

$hash_element is a key into the hash, it should have a value
already, otherwise it doesn't make a lot of sense.

-- 
Sam

comments on data are usually much more helpful than on algorithms
	--Rob Pike


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

Date: 9 Apr 1999 20:24:20 -0500
From: danny@see.the.message (Danny Chang)
Subject: Re: How Do I Declare A Hash Without Errors?
Message-Id: <3710a6b4.89121538@news3.newscene.com>

Thanks for the help and the clarity on declaring hashes. My main
problem was that I was writing a script to process CGI form data which
initializes the %ENV hash. Running from the command line gave me the
'unitialized value' warnings. Through the browser everything works
nicely. Sometimes the obvious can be the most elusive.

Danny Chang
danny@heartmind.org




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

Date: Fri, 09 Apr 1999 21:42:05 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: How Do I Declare A Hash Without Errors?
Message-Id: <370EAC6D.47EACDB0@erols.com>

Hashes for Dummies, from a former Dummy:

A hash is an associative array. This means the indicies are strings, not numbers.

An array is initialized with

my @arrayFoo = ();

Therefore:

my %hashFoo = (): #Note use of parens!

Any individual value of an array is a scalar. To get at it, you need "scalar" access, which means dollar sign:

$arrayFoo[6] = 'yomama';

Any individual value of an hash is a scalar. To get at it, you need "scalar" access, which means dollar sign:

$hashFoo{'six'} = 'yomama';

Mass assignments for an array:

my @arrayFoo = ( 'foo', 'bar', 'baz', 'boffo', 'yuk', 'llama' );

Mass assignments for a hash:

my %hashFoo = ( 'zero', 'foo', 'one', 'bar', 'two', 'baz', 'three', 'boffo', 'four', 'yuk', 'five', 'llama' );

You need double the initialization 'cause the indicies are not implied by position as in an array. The above is more commonly expressed as:

my %hashFoo = ( 'zero' =>'foo', 'one' => 'bar', 'two' => 'baz', 'three' => 'boffo', 'four' => 'yuk', 'five' => 'llama' );

The => is exacly equal to a , and you COULD use it just about anywhere a comma is, but the bit of 'syntactic sugar' is usually reserved for hash usage.

HTH

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Sat, 10 Apr 1999 02:10:37 +0100
From: "Patrizio!" <pkkc@btinternet.com>
Subject: Re: How do I grab a page on the net using sockets?
Message-Id: <370EA4FE.AAC6D339@btinternet.com>


> 
> use LWP::Simple;
> $his_page = get "http://www.his.server.com/his/url/goes/here";
> 

Tried on MacPerl, but get the following result:

<HTML>
<HEAD>
<TITLE>
An Error Occurred
</TITLE>
</HEAD>
<BODY>
<H1>An Error Occurred</h1>
501 - # Protocol scheme 'http' is not supported
File 'Patrizio:Applications:MacPerl :lib:LWP:UserAgent.pm'; Line 206

</BODY>
</HTML>

What happened? Any fix?

Patrick K.K. Chung <pkkc@btinternet.com>


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

Date: 9 Apr 1999 23:14:59 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Insecure dependency in system ...
Message-Id: <slrn7gt2fi.bdj.sholden@pgrad.cs.usyd.edu.au>

On 9 Apr 1999 22:46:03 GMT, Yury Yaroshevsky <yk@go.ipclub.dn.ua> wrote:
>Hi All!
>
>I'm get next messages, alter running my script:
>
>Insecure dependency in system while running setuid at ip.pl line 97.
>
>In source, at line 97:
>
>system "$IFCMD add 42$Station deny tcp from $IP to $IP_Server 119,3128 in recv fxp0"
>
>Where:
>$IFCMD="/sbin/ipfw".
>$Station="199"
>$IP="10.0.0.199"
>$IP_Server="10.0.0.1"
>at moment running this line.

Are any of those variables got from the user or environment. If so then perl
considers them insecure. Since they might contain shell metacharacters. The
system invokes a shell which means that could really ruin your day.

You can either untaint the variables by using a regular expression to
extract the bits you are interested in (perl will assume you made sure
your regex didn't capture metacharacters without escaping them).

Or you can use the LIST version of system :

system $IFCMD, 'add', "42$Station", 'deny', 'tcp', 'from',
       $IP, 'to', $IP_Server, '119,3128', 'in', 'recv', 'fxp0';

I've probably missed a quote or comma ...

>Help me with right writing this line, please. 
>Reading 'man perlsec' does't help me :(

It does have a big list of secure and insecure things.
Your one is insecure if any of those variables are
tainted. 

-- 
Sam

I would like to tell you that Perl is simple in its complexity. But some
people won't understand that. So pretend I didn't say that, unless you
do.   --Larry Wall


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

Date: Fri, 09 Apr 1999 19:16:08 -0400
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: karynelk@my-dejanews.com
Subject: Re: MQ Series, C/C++, UNIX, Windows NT -- Southern California Talent  Search
Message-Id: <370E8A38.88BB4AEB@giss.nasa.gov>

grep -i perl < karynelk_wrote | wc
       0       0       0

	Jay Glascoe


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

Date: Fri, 09 Apr 1999 23:04:20 GMT
From: karynelk@my-dejanews.com
Subject: MQ Series,C/C++,UNIX,Windows NT -- Southern California Talent
Message-Id: <7em11g$bsi$1@nnrp1.dejanews.com>

RK Consulting, LLC is an application development consulting firm located in
Southern California.  We service a large number of fortune 500 clients
located in the greater Los Angeles area.  We are looking for superior talent
in the area of application programming and generalist information technology
skills.  Currently we have immediate openings for application programmers
with a minimum of three years of experience in US based companies.  Our skill
requirements are:

C/C++,UNIX,AIX,Visual Basic,SQL Server,Windows NT.  We are also looking for
candidates with the above mentioned programming skills as well as IBM's MQ
Series messaging systems.

We offer excellent benefits and salary along with full time opportunities. 
We are not looking for contractors.  We are looking for individuals who are
interested in joining the exciting world of consulting.  Our consultants must
have a bachlors degree	in computer science with three years of US based
experience as a application programmer in a client server/mainfra

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


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

Date: Fri, 09 Apr 1999 23:48:12 GMT
From: corey@americanrecruitment.com (Corey Saltiel)
Subject: regarding anonymous subroutines, and typeglobs
Message-Id: <slrn7gt46u.fl.corey@valis.americanrecruitment.com>


Greetings,


   I've recently begun looking into the construction and use of
   anonymous subroutines and typeglobs ... and I have a few
   questions as to when/why certain constructs of these should be
   used over others. I've read a bit here and there, but the 
   practicality of some of the concepts are still somewhat unclear 
   to me.

   I realize passing data around through reference rather than
   directly better utilizes resources, and I know one reason
   to create anonymous subs is to allow one to pass a subroutine
   to another.  Thats about as deep as my knowledge runs, however.

   The following is some code. I would very much apreciate any 
   helpfull clues anyone could provide to me concerning when
   and why I would prefer any one of these constructs over any
   of the others:


# store anon sub
$sub_ex1 = sub { print "sub_ex1 is @_\n" };

# store reference to anon sub
$sub_ex2 = \sub { print "sub_ex2 is @_\n" };

# store anon sub into typeglob
*sub_ex3 = sub { print "sub_ex3 is @_\n" };

# store ref to anon sub into typeglob
*sub_ex4 = \sub { print "sub_ex4 is @_\n" };

# plain 'ol no frills sub
sub sub_ex { print "sub_ex is @_\n" }


sub_ex("sub_ex");

&{$sub_ex1}("sub_ex1");

&{$$sub_ex2}("sub_ex2");

sub_ex3("sub_ex3");

&$sub_ex4("sub_ex4");



   Thanks so much.



Beers!

Corey


---

   "I can say that I don't know what I'm doing, 
	but I can't say I have the time."

	   -- The Slackers




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

Date: Fri, 09 Apr 1999 19:16:03 -0400
From: Jimi Mikusi <jimbox@lucent.com>
To: Arthur Newhall <anewhall@whoi.edu>
Subject: Re: Regex with lookahead help
Message-Id: <370E8A33.8369CA0@lucent.com>

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

Arthur Newhall wrote:

>     I am having trouble creating a regex to do this
> "match everything up to the first  %  that isn't preceded by a \"

not that you havent gotten a lot of good help already, but...

your opening statement answers your own question.  you wanna find
something that isnt preceded by something else, yet your pattern says
look for something _suceeding_ something else, no?

what you want is _negative_look_behind_.  you wanna find a '%' not
PREceded by a '\'.  ergo: /(?<!\\)%/.   not a complete solution, but
hopefully it'll help you better understand the line of thinking you
should be using.

jimbox->goodluck();



--------------00FA9F811CECA0D0DF0655D1
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jimi Mikusi
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Jimi Mikusi
n:              Mikusi;Jimi
org:            Inferno Apps Team (VV0122000)
email;internet: jimbox@lucent.com
title:          Applications Developer
tel;work:       732-577-2740
tel;fax:        732-577-2727
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------00FA9F811CECA0D0DF0655D1--



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

Date: Fri, 09 Apr 1999 21:44:59 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: RTFM please!  perldoc PSI::ESP (was Re: Validating Email addresses)
Message-Id: <370EAD1B.824B78B3@erols.com>

David Cassell wrote:
> 
> I R A Aggie wrote:
> >
> > On Tue, 06 Apr 1999 16:15:46 GMT, Clinton Pierce
> > <cpierce1@ford.com>, in <370c253d.518582912@news.ford.com> wrote:
> >
> > + This is a perfect use for that PSI::ESP module again.  In fact, this is
> > + quoted as an example in the documentation.  Please RTFM!
> >
> > Has this been posted to CPAN? when I try to install it from the cpan
> > shell (perl -MCPAN -e shell), I get:
> >
> > cpan> install PSI::ESP
> > Warning: Cannot install PSI::ESP, don't know what it is.
> >
> > cpan> i /PSI::ESP/
> > No objects found of any type for argument /PSI::ESP/
> >
> > Or is this soemthing that will be automatically installed on my system
> > thru something like PSI::INSTALL?
> >
> > James
> 
> Surely CPAN will now know when you actually need the module?  :-)
> 

Hey, here's a thought: Maybe the PSI:: family could be the basis for the kernel of the DWIM machine!

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Fri, 09 Apr 1999 21:11:23 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: SORT BY DATE
Message-Id: <370EA53B.61965168@erols.com>

Larry Rosler wrote:
> 
> Very funny.  This is degenerating into silliness. 

You want silly? How about this solution:

ABDETY

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Fri, 09 Apr 1999 18:09:02 -0700
From: Aaron Tavistock <APTavistock@lbl.gov>
Subject: Re: SORT BY DATE
Message-Id: <370EA4AE.8A1DF53B@lbl.gov>

'Windowing' (the term thats been given to a context approach) has some
major drawbacks.  All you've really done by windowing is reduce the
chance you cross the century mark, but it doesn't prevent crossing it.  

The simplest example of this would be a piece of code that looks at
birthdays, when turning 40 (born in 1960) the computer this you would be
turning -60 (born in 2060).  Of course you could tune your window to the
best place, but it still doesn't the problem.

Ultimately its nigh-trivial to use 4 digit years and there really no
reason that code written today shouldn't use them.

AT

Larry Rosler wrote:
> 
> [Posted and a courtesy copy mailed.]
> 
> In article <370E4991.AF94C93D@giss.nasa.gov> on Fri, 09 Apr 1999
> 14:40:17 -0400, Jay Glascoe <jglascoe@giss.nasa.gov> says...
> > Larry Rosler wrote:
> > >
> > > Oh, here we go again.  There is absolutely nothing wrong with
> > > representing a year as a two-digit number, in applications where the
> > > problem CONTEXT can determine the correct century unambiguously.
> >
> > Okay, I'll bite:  Bababozorg, what is your problem context?
> > Does your problem domain involve past/present/future dates?
> > Is it even *slightly* conceivable that your code will be
> > around a year from now?
> >
> > At any rate, here's a line of Perl for you:
> >
> > sub for_sort { sprintf "%02d%02d%02d", (split '-', shift)[2,0,1] }
> >
> > obviously this breaks if you've the years, say, 1996 and 2003
> > being represented by "96" and "3", resp.
> 
> That is why I shouted CONTEXT in my response.  I guess you didn't hear
> it anyhow.
> 
> The CONTEXT must be supplied by the code.  For many, if not most,
> problem domains, the following will suffice quite well:
> 
>   $year += $year > 69 ? 1900 : 2000 if $year < 100;
> 
> If this 100-year window doesn't suit your problem domain, use a
> different window to disambiguate the year.
> 
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com


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

Date: Fri, 09 Apr 1999 23:24:26 GMT
From: njc@dmc.uucp (Neil Cherry)
Subject: Re: Sys::Syslog
Message-Id: <slrn7gt359.41i.njc@dmc.uucp>

On Fri, 09 Apr 1999 20:27:24 GMT, Marc Haber wrote:
>njc@dmc.uucp (Neil Cherry) wrote:
>>On Fri, 09 Apr 1999 13:52:29 GMT, Marc Haber wrote:
>>>Kozo <kozo@pobox.sk> wrote:
>>>>perl is This is perl, version 5.004_04 built for i386-linux
>>>>from perl-5.004m4-1 on RH 5.2
>>>
>>>There are some rumours of a broken perl with certain RedHat versions.
>>>This is known to affect majordomo.
>>
>>That would explain why it doesn't work on my RH system. Sounds like it
>>may not be perl though as I rebuilt (fresh compile) and got the same
>>thing.
>
>Did you try the latest rpm from RedHat?
>
>Greetings
>Marc

Nope, but I'll try to d/l it again (busy servers).

-- 
Linux Home Automation           Neil Cherry             ncherry@home.net
http://members.home.net/ncherry                         (Text only)
http://meltingpot.fortunecity.com/lightsey/52           (Graphics GB)
http://www2.cybercities.com/~linuxha/			(Graphics US)


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

Date: Fri, 09 Apr 1999 21:17:31 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Thank You comp.lang.perl.misc!
Message-Id: <370EA6AB.DB623439@erols.com>

Aaron Dickinson wrote:
> 
> Thank you all for being roll models for other
> programmers out on the Net... 

Roll model? ROLL MODEL?? We're no steenkeen Pilsbury dough boys!!

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: 9 Apr 1999 23:22:11 GMT
From: vince@sixpak.cs.ucla.edu (Vince Busam)
Subject: Threads problem
Message-Id: <slrn7gt2t2.ead.vince@sixpak.cs.ucla.edu>

When running a small Thread program on an SMP linux machine, my program
gives a segmentation fault rather quickly.  However, on a uniprocessor
machine, the program will run a long time (until I get impatient and kill
it).

Crashes on (Dual Pentium II, kernel 2.0.36):
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.0.36, archname=i686-linux-thread
    uname='linux alien 2.0.36 #5 wed jan 20 02:18:14 est 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-D_REENTRANT -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 -lpthread -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 Apr  8 1999 16:30:47
  @INC:
    /usr/local/perl/lib/5.00503/i686-linux-thread
    /usr/local/perl/lib/5.00503
    /usr/local/perl/lib/site_perl/5.005/i686-linux-thread
    /usr/local/perl/lib/site_perl/5.005
    .

Works on (K6, now running kernel 2.2.5, also works with 5.002_02 compiled on
2.0 kernel):

Summary of my perl5 (revision 5.0 version 5 subversion 56) configuration:
  Platform:
    osname=linux, osvers=2.2.3, archname=i586-linux-thread
    uname='linux sixpak.cs.ucla.edu 2.2.3 #1 fri mar 12 13:42:48 pst 1999
i586 unknown '
    config_args='-Dusethreads -Dprefix=/usr/local/perl -Uinstallusrbin -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include
-I/opt/local/include'
    ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include
-I/opt/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 -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -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
-L/opt/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Apr  5 1999 16:37:18
  @INC:
    /usr/local/perl/lib/5.00556/i586-linux-thread
    /usr/local/perl/lib/5.00556
    /usr/local/perl/lib/site_perl/5.00556/i586-linux-thread
    /usr/local/perl/lib/site_perl/5.00556
    .

Are there race conditions in this program I'm unaware of, or is this a perl
bug, or... what?

Thanks,
Vince

I've isolated the problem to reproduce with this:
#!/usr/bin/perl -w

use Thread;
use Thread::Semaphore;

my $sem = new Thread::Semaphore;
my @tdone = ();
my @tlist = ();

for (my $i = 0; $i < 10; $i ++) {
  $tdone[$i] = 0;
  $tlist[$i] = 0;
}

while (1) {
  my $tid = -1;
  while ($tid < 0) {
    for (my $t=0; $t < 10; $t++) {
      $sem->down;
      if ($tdone[$t]) {
        $tlist[$t]->join;
        $tlist[$t]=0;
        $tdone[$t]=0;
        $tid = $t;
      } elsif ($tlist[$t] == 0) {
        $tid = $t;
      }
      $sem->up;
    }
  }
  $tlist[$tid] = new Thread \&threadsub, $tid;
}

sub threadsub {
  my $tid = shift;
  print "$tid\n";
  $sem->down;
  $tdone[$tid] = 1;
  $sem->up;
  return;
}


-- 
-----------------------------------
Vince Busam
vince@sixpak.cs.ucla.edu
http://www.cs.ucla.edu/~vince/



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

Date: Fri, 9 Apr 1999 17:38:10 -0600
From: "Eric Arnold" <nospam_earnold@requisite.com>
Subject: Re: Trouble with DBI and Oracle
Message-Id: <7em30q$11d$1@news1.rmi.net>

This works for me on Solaris and NT:

my $dbh = DBI->connect( "dbi:Oracle:SIDhostname", "username", "password" );

where "SIDhostname" is the identifier in tnsnames.ora

Darren Greer wrote in message <370aaea0.84462871@news.qgraph.com>...
>Sorry for the repost: I had the subject in the wrong field:
>
>
>Howdy all....I am having problems with DBI and Oracle.  Below is my
>code, to access our Database, and perform a simple query.  Following
>the code, is the error I get.
>
>--------------------- CODE ----------------------
>#!/usr/bin/perl -w
>
>use DBI;
>
>$ENV{ORACLE_HOME} = '/usr/oracle/7.3.4';
>$ENV{TWO_TASK} = 'T:homer:QTI';
>
>my $dbh = DBI->connect('dbi:Oracle:','drgreer/drgreer@QTI','');
>
>$query = "SELECT partnumber FROM partmaster WHERE partno = '108755'";
>
>my $sth = $dbh->prepare($query) || die "Cant execute prepare
>statement";
>my $rc = $sth->execute || die "Cant execute statment: $DBI::errstr";
>
>print "$sth->{NAME}->[0]\n";
>
>while (@row = $sth->fetchrow_array) {
> print "$row[0]\n";
>}
>
>$sth->finish;
>$dbh->disconnect || warn $sth->errstr;
>--------------- END CODE --------------
>
>This is not much of an error, as it is more of a lock-up.  This was
>run from the debugger, and below, is the point where it locks up.  The
>debugger never gets past the "connect" line in the code.  The
>following is where my code locks up, and sites there eating a TON of
>cpu.  The process eventually has to be killed, to stop it.   Any help
>or insight would be greatly appreciated.
>
>------------------ ERROR -----------------
>  DB<1>
>DBD::Oracle::dr::connect(/opt/perl5/lib/site_perl/DBD/Oracle.pm:206):
>206:            DBD::Oracle::db::_login($dbh, $dbname, $user, $auth)
>207:                or return undef;
>  DB<1>
>---------------------------------------------------
>
>Darren
>




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

Date: Fri, 09 Apr 1999 21:14:58 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Y2K (yes, again - sorry!)
Message-Id: <370EA612.C4EC261@erols.com>

Matt Sergeant wrote:
> 
> Someone mailed me directly the other day (like I'm some kind of
> authority on the subject!) asking me for a statement as to whether perl
> was y2k compliant. I gave the standard answer, and the URL on
> www.perl.com.

Who is this someone? Is it a supplier of yours? A customer of yours? Anyone at all who you have any dealings with at all on a business or personal basis?

If not, you should have ignored them. If so, then your business needs to be legally prepared anyway.

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

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

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