[19789] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1984 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 22 18:06:22 2001

Date: Mon, 22 Oct 2001 15:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1003788306-v10-i1984@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 22 Oct 2001     Volume: 10 Number: 1984

Today's topics:
    Re: [off topic] Thanks to all people here :-) <wmgrar@earthlink.net>
    Re: \Z regexp behavior different with $& in program <nospam-abuse@ilyaz.org>
        Array of filehandles <Steven.Work@uvm.edu>
    Re: Array of filehandles (Clinton A. Pierce)
    Re: Fork messes up parent file handle? <je@brighton.ac.uk>
    Re: Fork messes up parent file handle? <je@brighton.ac.uk>
    Re: Fork messes up parent file handle? <joe+usenet@sunstarsys.com>
    Re: Fork messes up parent file handle? <joe+usenet@sunstarsys.com>
    Re: Good Literature <dave@dave.org.uk>
        Greediness and Regular Expressions <syrag@my-deja.com>
    Re: IE4 onLoad in .pl pages <flavell@mail.cern.ch>
    Re: IO::Socket broken on win (Garry Williams)
    Re: Objects: Setting defaults and calling themselves?? (Xeno Campanoli)
        Perl Vs. Java <krishna.kumar@rhii.com>
    Re: Perl Vs. Java (Tad McClellan)
    Re: Perl Vs. Java <rereidy@indra.com>
    Re: Perl Vs. Java <peterhi@shake.demon.co.uk>
    Re: Perl Vs. Java <krishna.kumar@rhii.com>
    Re: Problem with cpan db_file-1.78 / linux redhat 7.1 (Jason Kohles)
    Re: Splitting a string into an array of chars <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Tool to help understand unknown Perl source code (Miko O'Sullivan)
    Re: xsub - does anything work? <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 22 Oct 2001 21:38:51 GMT
From: "reiss robert" <wmgrar@earthlink.net>
Subject: Re: [off topic] Thanks to all people here :-)
Message-Id: <Ll0B7.3000$Sd.269850@newsread1.prod.itd.earthlink.net>

> I know it's could be considered as "off topic" but I just wanted to
> thank all people posting answers on this NG.

Someone once wrote:
"Please get this drivel out of comp.lang.c and post it to
alt.marypoppins.saccharine where belongs.  Flames are welcome,compliments
are off-topic. ;-)"




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

Date: Mon, 22 Oct 2001 19:36:00 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: \Z regexp behavior different with $& in program
Message-Id: <9r1sf0$1bcd$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Jason Secosky
<secosky@attglobal.net>], who wrote in article <64a73ed6.0110220555.66bce4a6@posting.google.com>:
> perl5.6.0 -wle '$_= "a\nb\n"; /b$/m or print 11; /a\Z/m and print 12;
> print $&'
> b
> 
> perl5.6.0 -wle '$_= "a\nb\n"; /b$/m or print 11; /a\Z/m and print 12;'
> 12
> 
> I would have expected the second script to not print anything. 
> Instead, 12 is output indicating that the match was successful.

I see now.  This is in my list of bugs-to-fix (as the test suite
indicates...).  But since I do not care much about Perl success
anymore, the timeline is not defined...

Ilya


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

Date: Mon, 22 Oct 2001 14:44:51 -0400
From: Steven Work <Steven.Work@uvm.edu>
Subject: Array of filehandles
Message-Id: <3BD46923.BFAE92CD@uvm.edu>


I'm new to perl and have a (probably simple) question on creating an
array of file handles. Basically, I'm about to write out to N number of
separate files. 

	# open files ahead of time
	for ( $index = 0; $index < $maxfiles; ) 
	{
		$fn = "$filename$index$filenameext"; 
		open (PPM, $fn) or die "Problem: $fn $!";
		$ppm[$index] = \PPM; 
		$index++;
	}


later when I use

	print $ppm[$index] "P5\n# $line$x $y\n255\n$frame";

I get the following error.
	String found where operator expected line 43, near "]  (line 43 is the
print statement)

I've tried a few variations, such as:

	KPPM = ${$ppm[$index]}; # and KPPM = $ppm[$index];
	print KPPM "P5\n# $line$x $y\n255\n$frame";

I've tried direct allocation into a filehandle: 
	...
		open ( PPM[$index], $fn) or die "Problem: $fn $!";
	...
	print PPM[$index] "P5\n# $line$x $y\n255\n$frame";

I suspect I need to allocate the filehandle directly into an array, but
have not discovered the form this would take.

Any suggestions would be appreciated.

Regards,
Steve


-- 
---------- Steve Work ---------
Steven.Work@uvm.edu
802-656-7867, fax:(802)656-0747
Health Science Research Facility
Rm: 115A, Dept. of Mol. Physiology
University of Vermont
Burlington, VT USA 05405

"Home of the Light Tweezers"


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

Date: Mon, 22 Oct 2001 21:26:53 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Array of filehandles
Message-Id: <xa0B7.195608$K6.93126344@news2>

[Posted and mailed]

In article <3BD46923.BFAE92CD@uvm.edu>,
	Steven Work <Steven.Work@uvm.edu> writes:
> later when I use
> 
> 	print $ppm[$index] "P5\n# $line$x $y\n255\n$frame";
> 
> I get the following error.
> 	String found where operator expected line 43, near "]  (line 43 is the
> print statement)

Yup.  Perl wants an identifier (i.e. a bareword) or a simple scalar 
variable name for a filehandle in that spot.  Try:

	$f=$ppm[$index];
	print $f ".....";

Or some variation of that instead.

-- 
    Clinton A. Pierce            Teach Yourself Perl in 24 Hours  *and*
  clintp@geeksalad.org                Perl Developer's Dictionary
"If you rush a Miracle Man,     for details, see http://geeksalad.org     
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Mon, 22 Oct 2001 19:03:48 +0100
From: John English <je@brighton.ac.uk>
Subject: Re: Fork messes up parent file handle?
Message-Id: <3BD45F84.E62472B7@brighton.ac.uk>

Benjamin Goldberg wrote:
> I haven't a clue as to why it's happening, but perhaps you could fix or
> work around it with seek/tell?

Well, I solved it by slurping the file into an array before going
into the loop... but I'd still like to know what's going on with
the orginal version, just for my own understanding...

Thanks,

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.comp.it.bton.ac.uk/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------


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

Date: Mon, 22 Oct 2001 19:02:04 +0100
From: John English <je@brighton.ac.uk>
Subject: Re: Fork messes up parent file handle?
Message-Id: <3BD45F1C.AD56528@brighton.ac.uk>

Andrew Gierth wrote:
> 
> >>>>> "John" == John English <je@brighton.ac.uk> writes:
> 
>  John> Why should forking a child affect the parent's copy of a file
>  John> handle?
> 
> Because while the file _descriptor_ is copied, the underlying open
> file reference (which includes the current file position) is _shared_,
> not copied. If the child does anything that causes lseek() to be
> called on the file, then the parent will become confused (because its
> idea of where the position should be will no longer match reality).

Thanks. This is presumably the root cause of the problem, but I'm
still baffled because the child doesn't access the file handle at
all. I've tried closing the file handle as the first thing the child
does in case it was something like this, and it makes no difference.
Something somewhere is presumably messing around with the file, but
I have absolutely no idea what it might be yet...

Sigh. Thanks for clarifying that, anyway...

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.comp.it.bton.ac.uk/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------


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

Date: 22 Oct 2001 15:07:51 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Fork messes up parent file handle?
Message-Id: <m3elnv7at4.fsf@mumonkan.sunstarsys.com>

John English <je@brighton.ac.uk> writes:

> What happens is that when a child processes is forked off, the
> parent goes round the loop again and reads the next line from the
> file, except that the file handle has magically been reset to the
> beginning of the file (or a few bytes from the beginning), and
> instead of forking off about a dozen processes I end up forking
> about two thousand of them! (FWIW, this is using Perl 5.6.1 on
> Solaris 8 on a Sun machine.)
> 
> Interestingly, the script terminates after a lengthy but finite
> time -- it doesn't seem to go on doing this forever, but what
> it does on any particular occasion is pretty nondeterministic.
> If I only have a couple of lines in the config file, it seems to
> work fine.

What does this say:

    % perl -V | grep perlio

I've seen very similar problems with PerlIO and filehandle duping.

-- 
Joe Schaefer                     "I'll sleep when I'm dead."
                                               -- Warren Zevon



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

Date: 22 Oct 2001 17:51:25 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Fork messes up parent file handle?
Message-Id: <m37ktn738i.fsf@mumonkan.sunstarsys.com>

Joe Schaefer <joe+usenet@sunstarsys.com> writes:

> John English <je@brighton.ac.uk> writes:
> 
> > What happens is that when a child processes is forked off, the
> > parent goes round the loop again and reads the next line from the
> > file, except that the file handle has magically been reset to the
> > beginning of the file (or a few bytes from the beginning), and
> > instead of forking off about a dozen processes I end up forking
> > about two thousand of them! (FWIW, this is using Perl 5.6.1 on
> > Solaris 8 on a Sun machine.)
> > 
> > Interestingly, the script terminates after a lengthy but finite
> > time -- it doesn't seem to go on doing this forever, but what
> > it does on any particular occasion is pretty nondeterministic.
> > If I only have a couple of lines in the config file, it seems to
> > work fine.
> 
> What does this say:
> 
>     % perl -V | grep perlio
> 
> I've seen very similar problems with PerlIO and filehandle duping.

Actually PerlIO is probably irrelevant. It may just be a solaris 
issue with 5.6.1- see if you can reproduce the problem listed here:

  http://archive.develooper.com/perl5-porters@perl.org/msg65856.html

(It seems to be OK for linux).
-- 
Joe Schaefer   "Under certain circumstances, profanity provides a relief denied
                                       even to prayer."
                                               --Mark Twain



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

Date: Mon, 22 Oct 2001 20:31:14 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Good Literature
Message-Id: <3BD47402.3B1BDFDB@dave.org.uk>

Uri Guttman wrote:

> now why couldn't this have happened BEFORE it was published? why don't
> these authors and publishers get competent tech reviewers? why do they
> operate outside of the active perl community? where and who are the
> masses who buy those books and why don't they participate in the
> community and learn better perl habits? it is a puzzle to me how there
> is a known very active community and then this much larger shadow perl
> world where bad cgi code r00lz, learning proper programming and perl
> is never encouraged and mattwright is the one eyed king.

The person who works out the answers to these puzzles will earn the
undying gratitude of the Perl community :)

I don't have all the answers, but here's my current theory.

The people who buy these books aren't "programmers" in any sense of the
word. They simply want to put guestbooks and hit counters on their web
pages. That has to be easy right? Because web stuff is _always_ easy.
Bill Gates said so.

Therefore they don't look for an introduction to programming, or even an
introduction to Perl. No, they leap straight in and go for a book that
teaches them CGI programming.

And there are plenty to choose from. Most of them a complete waste of
paper. Liz Castro's "Perl and CGI for the WWW" is a lot better than it
was, but it's still not a great book. All of the other "Learn Perl and
CGI" books are rubbish.

There aren't any "Learn Perl and CGI" books written by anyone respected
by the Perl community. Why is that? I guess it's because respectable
Perl writers know that it's nigh on impossible to teach a) programming,
b) Perl and c) CGI in one 200 page book (with lots of pictures). Also,
they'd far rather be writing cooler books that _we_ will appreciate.

The three good Perl/CGI books that we have (the mouse book, the spiky
ball book and Lincoln's guide to CGI.pm) fail to appeal to beginners. In
fact, tey all assume a certain level of Perl knowledge.

There's also the fact that these idiot books all get _great_ reviews at
Amazon - because the people that read them don't know how bad they
really are. They can't know that they've just been taught a dangerous
bunch of half-truths.

The only solution that I can see is that _someone_ is going to have to
write a respectable Perl/CGI for beginners book. And it needs to leap of
the shelves of the bookshop before "CGI Programming 101" and all the
other books of that type. I don't know who's going to write that book.
It won't be me. I have far more interesting things to do.

Any volunteers?

Dave...


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

Date: Mon, 22 Oct 2001 16:47:57 -0500
From: "Syrag" <syrag@my-deja.com>
Subject: Greediness and Regular Expressions
Message-Id: <9r243g$gko$1@tilde.csc.ti.com>

I have a problem where I need to match 1 to 4 characters at the end of a
string that string that might be 1 to 8 characters long.

So I might have any of the following and want to match upto 4 characters at
the end of the line.

stuff: 6837 abcd1234  #want 1234
stuff: 6837 1234  #want 1234
stuff: 6837 34  #want 34

I tried this:
m/^\s*stuff: 5936837\s*\S*(\S{1,4})\s*\r?$/i
but this seems to be greedy and gets nothing unless there are more than 4
characters total.  (note, the part I want to match could be anything
aphanumeric, 1234 is just used above)

Is there any way to match this?  Or, is there any way to change the
greediness to be right to left or get around this?  I am sure there is
something silly I am missing somewhere.

Thanks,
Syrag




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

Date: Mon, 22 Oct 2001 20:29:56 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: IE4 onLoad in .pl pages
Message-Id: <Pine.LNX.4.30.0110222026080.32046-100000@lxplus023.cern.ch>

On Oct 22, Jeff Zucker inscribed on the eternal scroll:

> > triggered from a Javascript onLoad event in the body tag
>
> Perl has nothing to do with Javascript,

right

> see a newsgroup about Javascript

right

> or CGI.

I don't think so: an "onload event" happens client-side, but CGI
happens server-side.  There does exist such a thing as server-side
Javascript, but I don't think that's relevant here.

> And please do not respond that since your script is written in perl it
> is therefore a perl issue.

I think we all know what happens next in this kind of scenario.
But I suppose it's possible that I'm mistaken.

> Perl is only the intermediary and irrelevant
> to what the browser expects to see.

An important principle, indeed.

all the best.



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

Date: Mon, 22 Oct 2001 19:11:51 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: IO::Socket broken on win
Message-Id: <slrn9t8rrn.oua.garry@zfw.zvolve.net>

On Mon, 22 Oct 2001 06:25:27 -0400, Benjamin Goldberg
<goldbb2@earthlink.net> wrote:

> Fe wrote:
>> 
> [snip]
>> also i am missing a lot of error constants (even ubiquitous
>> EWOULDBLOCK)
> 
> When you 'use Errno', you don't get this constant?

What happened when you tried it? 

    $ perl -MErrno -wle 'print EWOULDBLOCK()'
    Undefined subroutine &main::EWOULDBLOCK called at -e line 1.
    $ perl -MErrno=EWOULDBLOCK -wle 'print EWOULDBLOCK()' 
    11
    $ perl -MPOSIX -wle 'print EWOULDBLOCK()'     
    11
    $

See the Errno manual page.  

-- 
Garry Williams


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

Date: 22 Oct 2001 18:37:14 GMT
From: xeno@eskimo.com (Xeno Campanoli)
Subject: Re: Objects: Setting defaults and calling themselves??
Message-Id: <9r1p0q$vlo$1@eskinews.eskimo.com>

I apologize if I'm a little to lazy to completely study your question.  When
it comes to locations of methods and usages a general rule I go by is define
the thing or use the thing as close as possible to where it is needed.  This
may make for more readable and more efficient code.  Also, follow established
standards for everything from Perl idioms and the standards of your own shop
to keeping your own programming style reasonably consistent when possible.
Also, keep the concepts of your classes simple if possible, or refactor them
to be simple when you get time.  

Ed Kulis (ekulis@apple.com) wrote:
: Hi,

: I'm new at object design and I'm not sure of the conventions for an object calling itself after setting some defaults.

: (Please forgive the rambling nature of this posting. I welcome any comments including the idea that this is all the entirely wrong
: way to to this.  Object design is not yet second nature for me.)

: I've written a number of methods that do elementary operations on RCS.

: The elementary operasions called from a script like this:

: package main;
: use lib ".";
: use CrmRcs;
: use CrmUtil;

: my $rcsdo1 = CrmRcs->new('Testing the Auto Rcs Differ');

:     $rcsdo1->rcsrevdir   ('RCS') ;
:     $rcsdo1->rcsworkdir  ('.');
:     $rcsdo1->rcsworkspec ('GET_XML-FUNCTION.SWBAPPS.VNTVD.ora');

:     my $revexists =
:         $rcsdo1->rcsrevspec  ('GET_XML-FUNCTION.SWBAPPS.VNTVD.ora,v');

: (See Module Details below for a sketch of the package and how it handles the $type ref etc.)

: I would like to relegate the calls in the main package to the CrmRcs.pm package or some other package so that I can create a higher
: level of abstraction like:

:     rcscheckinchanges('GET_XML-FUNCTION.SWBAPPS.VNTVD.ora')

: which would use the elementary methods to check for the existence of the RCS files and then check in the working file only if
: rcsdiff showed a change. I've got all the modules to do the rcs operations and then to detect the responses from rcs

: THE QUESTION:
:     "Where should I put a method that calls other methods within the same instantiation?"

: Should I do this:

: package main;

: my $rcsdo1 = CrmRcs->new('Testing the Auto Rcs Differ');
: $rcschgs =
:     $rcsdo->rcscheckinchanges('GET_XML-FUNCTION.SWBAPPS.VNTVD.ora')

: then in the package CrmRcs;

: sub rcscheckinchanges
: {
:     my ($type , @args) = @_;
:     my $workspec = shift @args:

:     rcsrevdir      ($type,'RCS') ; # the defaults need to be handled better.
:     # passing the type ref to a sub in the same module?

:     rcsworkdir   ($type,'.');
:     rcsworkspec ($type,$workspec);

:     $do_checkin = &rcsworkdiff($type, $workspec);


:      if ($do_checkin)
:     {
:         &rcsworkci($type);
:         # rcsworkci will use values that were set in the class by previous
:         # method calls.
:     };
: .....
: }


: Module Details:

: my      $silly_one_to_keep_compiler_from_barfing = 1;
: return  $silly_one_to_keep_compiler_from_barfing;

: package CrmRcs ;

: sub new
: {
:     my     ($class, @args) =  @_;
:     my     $self  = {};
: ......
:     bless  $self, $class;
:     return $self;

: }

: sub rcsrevdir
: {
:     my ($type , @args) = @_;

: .....
: }





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

Date: Mon, 22 Oct 2001 11:52:45 -0700
From: "Krishna Kumar" <krishna.kumar@rhii.com>
Subject: Perl Vs. Java
Message-Id: <PO$b#qyWBHA.169@hqp_news_nt1.corp.rhalf.com>

Folks at my work are talking about using Java as a standard instead of Perl.

I have no knowledge of Java to agree or disagree with this.

They are trying to convince me that Java can do everything that Perl can.

I know enough Perl to know what it is capable of.  Hence I am taking their
statement with a pinch of salt.

I suspect that Perl can do certain things much better than Java and vice
versa.

I also suspect that thay are comparing apples with oranges.

Can someone help me with this please? Or point me to a website which brings
out the differences between Java and Perl?

Thanks in advance

Regards
KK




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

Date: Mon, 22 Oct 2001 19:38:35 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl Vs. Java
Message-Id: <slrn9t8qou.dsk.tadmc@tadmc26.august.net>

Krishna Kumar <krishna.kumar@rhii.com> wrote:

>Folks at my work are talking about using Java as a standard instead of Perl.

>Can someone help me with this please? Or point me to a website 


This one may help some:

   http://www.perl.org/phbs/


>which brings
>out the differences between Java and Perl?


But I don't know that it does that.

There is also a mailing list for discussing Perl advocacy:

   http://lists.perl.org/showlist.cgi?name=advocacy


I also see that a google.com search for your Subject: above
finds 163 hits  :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 22 Oct 2001 15:22:38 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Perl Vs. Java
Message-Id: <3BD48E1E.F3B1DC69@indra.com>

Krishna Kumar wrote:
> 
> Folks at my work are talking about using Java as a standard instead of Perl.
> 
> I have no knowledge of Java to agree or disagree with this.
> 
> They are trying to convince me that Java can do everything that Perl can.
> 
> I know enough Perl to know what it is capable of.  Hence I am taking their
> statement with a pinch of salt.
> 
> I suspect that Perl can do certain things much better than Java and vice
> versa.
> 
> I also suspect that thay are comparing apples with oranges.
> 
> Can someone help me with this please? Or point me to a website which brings
> out the differences between Java and Perl?
> 
> Thanks in advance
> 
> Regards
> KK
So if Java can do everything Perl does, and you already use Perl, why
change (aka - if it ain't broke, don't fix it)?
-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


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

Date: Mon, 22 Oct 2001 22:41:15 +0100
From: "Peter Hickman" <peterhi@shake.demon.co.uk>
Subject: Re: Perl Vs. Java
Message-Id: <1003786803.26581.0.nnrp-10.9e980a61@news.demon.co.uk>

"Krishna Kumar" <krishna.kumar@rhii.com> wrote in message
news:PO$b#qyWBHA.169@hqp_news_nt1.corp.rhalf.com...
> Folks at my work are talking about using Java as a standard instead of
Perl.

I know that this is unproven but when people start to talk of Java I think
of
Ars Digita and the place I used to work at. 'Lets do it in Java' seems to be
the
nail in the coffin of many a project and in some cases entire companies.

What is it that Java can do they these people are saying that Perl cannot?
Without knowing Java you can still assess this claimed deficiency, and then
ask even
if Perl cannot do it is it a problem?

I've seen some very well paid Java programmers but I have yet to witness a
successful project. I would question the motives of these people.

But then I'm a cynic!





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

Date: Mon, 22 Oct 2001 14:59:34 -0700
From: "Krishna Kumar" <krishna.kumar@rhii.com>
Subject: Re: Perl Vs. Java
Message-Id: <u4VsWT0WBHA.169@hqp_news_nt1.corp.rhalf.com>

No I think the assumption is Java is easier to learn than Perl.

And of course Java's well paid programmers raison d'etre

Unfortunately Perl needs to hire some marketing folks from M$ or Sun as some
of our managers had not even heard of Perl until this discussion cropped up.



"Peter Hickman" <peterhi@shake.demon.co.uk> wrote in message
news:1003786803.26581.0.nnrp-10.9e980a61@news.demon.co.uk...
> "Krishna Kumar" <krishna.kumar@rhii.com> wrote in message
> news:PO$b#qyWBHA.169@hqp_news_nt1.corp.rhalf.com...
> > Folks at my work are talking about using Java as a standard instead of
> Perl.
>
> I know that this is unproven but when people start to talk of Java I think
> of
> Ars Digita and the place I used to work at. 'Lets do it in Java' seems to
be
> the
> nail in the coffin of many a project and in some cases entire companies.
>
> What is it that Java can do they these people are saying that Perl cannot?
> Without knowing Java you can still assess this claimed deficiency, and
then
> ask even
> if Perl cannot do it is it a problem?
>
> I've seen some very well paid Java programmers but I have yet to witness a
> successful project. I would question the motives of these people.
>
> But then I'm a cynic!
>
>
>




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

Date: 22 Oct 2001 20:25:39 GMT
From: usenet@jasonkohles.com (Jason Kohles)
Subject: Re: Problem with cpan db_file-1.78 / linux redhat 7.1
Message-Id: <slrn9t902e.tla.usenet@poseidon.mediabang.com>

On 21 Oct 2001 19:23:01 -0700, Michael J Rogers wrote:
>Hi,
>
>I've got a fresh linux redhat 7.1 with most of the updated RPM's and a
>Fresh perl 5.6.1 that I built from scratch...
>
>I'm trying to install Sympa mailing list manager 3.2.1 and am having
>trouble installing some of the Perl Modules needed...
>
You need the db3-devel RPM, which contains the header files and development
information needed to compile applications against db3...



>When I try to install the first one db_file-1.78, here is what
>happens:
>
>Writing Makefile for DB_File
>cp DB_File.pm blib/lib/DB_File.pm
>AutoSplitting blib/lib/DB_File.pm (blib/lib/auto/DB_File)
>cc -c -I/usr/local/BerkeleyDB/include -fno-strict-aliasing
>-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g   -DVERSION=\"1.78\"
>-DXS_VERSION=\"1.78\" -fpic
>-I/usr/local/lib/perl5/5.6.1/i586-linux/CORE -DmDB_Prefix_t=size_t
>-DmDB_Hash_t=u_int32_t  version.c
>version.c:30:16: db.h: No such file or directory
>make: *** [version.o] Error 1
>  /usr/bin/make  -- NOT OK
>Running make test
>  Can't test without successful make
>Running make install
>  make had returned bad status, install seems impossible
>
>
>I've been searching through the forums all day with no luck, can
>anyone help or point me in the right direction?
>
>Thanks in advance,
>
>Michael Rogers
>M&A Computer Services
>
>Web Hosting, Co-location:  http://www.tristateweb.com


-- 
Jason S Kohles
email@jasonkohles.com          http://www.jasonkohles.com/


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

Date: Mon, 22 Oct 2001 20:54:58 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Splitting a string into an array of chars
Message-Id: <3BD46B82.7070101@post.rwth-aachen.de>

Thomas Bätzler wrote:

> On Mon, 22 Oct 2001, "Frederic SOUSTRA" <fredboard@sus.mcgill.ca> wrote:
> 
> 
>>How do i split a string into an array of characters?
>>
> 
> "Use split for clarity and unpack for efficiency" - Joseph N. Hall in
> "Effective Perl Programming".


And here is, just for the record, the corresponding unpack-solution:

my $n = "some_string";
my @chars = unpack "a" x length($n), $n;

  If one often needs to perform chopping a string into its single 
characters, one might hide the above not so very pretty code into a 
convenient subroutine, split2char($) or so.

[...]

Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: 22 Oct 2001 11:19:51 -0700
From: miko@idocs.com (Miko O'Sullivan)
Subject: Re: Tool to help understand unknown Perl source code
Message-Id: <db27ea77.0110221019.3f24d80@posting.google.com>

Per.Stromgren@ein.obliterate.ericsson.se 
> (Per Str?gren) wrote in message 
> news:<9r15of$9j6$1@newstoo.ericsson.se>...
>
> Do you know of any program of this sort or have other ideas how to
> solve the problem with the non-existent documentation? I suppose this
> does not happen in your company, but perhaps you know anyway.

I've found the Perltidy tool invaluable in working with other people's
messy code.  It reworks the code into a consistent and neat format.  I
find that clean formatting solves at least half the problem of reading
messy code.

You can get Perltidy at http://perltidy.sourceforge.net/

-miko


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

Date: Mon, 22 Oct 2001 19:33:25 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: xsub - does anything work?
Message-Id: <9r1sa5$1bbg$1@agate.berkeley.edu>

[A complimentary Cc of this posting was  sent to
Joe Schaefer 
<joe+usenet@sunstarsys.com>], who wrote in article <m33d4c8brr.fsf@mumonkan.sunstarsys.com>:
> > > Did you try left-justifying the sample code?  There should be no 
> > > leading spaces in your function declaration.
> > 
> > You mean the first row or two, right?  IIRC, all the rest is free-style...

> Yes- the error message he's getting comes from this section of xsubpp:
> 
>     death ("Code is not inside a function"
>            ." (maybe last function was ended by a blank line "
>            ." followed by a a statement on column one?)")
>         if $line[0] =~ /^\s/;

Yes, this is deliberate.  Otherwise empty lines in CODE or PPCODE declarations would lead to too much grief.

> Sorry for not checking this- of course you are right.  It's not 
> part of the 5.00503 nor 5.6.0 perlxs, but it is in 5.6.1.  It's
> made cut and paste of .h files much less tedious now- thanks :)

In fact I looked more, and did not find it documented that you can put
stuff on one line, as in

  double sin(double);

Sigh...  I think all these features are in 5.6.0, but my documentation
patch was lost, and I discovered it too late.  And when rewriting the
patch, I apparently missed the one-line feature...

Ilya


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.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.

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 V10 Issue 1984
***************************************


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