[19810] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2005 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 25 06:05:31 2001

Date: Thu, 25 Oct 2001 03:05:07 -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: <1004004307-v10-i2005@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 25 Oct 2001     Volume: 10 Number: 2005

Today's topics:
    Re: 'bash : *.gif' with regex, any nice idea ? <bart.lateur@skynet.be>
    Re: lookingglass.pl <bart.lateur@skynet.be>
    Re: lookingglass.pl <goldbb2@earthlink.net>
    Re: matching (Lex Thoonen)
    Re: Need help to find a regexp <mschur@web.de>
        NEWBIE: double sort on a string <jippie@yahoo.com>
    Re: Perl Vs. Java <edgue@web.de>
    Re: Perl Vs. Java <edgue@web.de>
    Re: Perl Vs. Java <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Perl Vs. Java (Logan Shaw)
    Re: Perl Vs. Java <edgue@web.de>
    Re: Perl Vs. Java <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Perl Vs. Java <edgue@web.de>
    Re: Perl Vs. Java <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Perl, MySQL, MS Access, Windows AND Linux <bart.lateur@skynet.be>
    Re: Regexp help needed Part 2 <goldbb2@earthlink.net>
    Re: syntax help? <bart.lateur@skynet.be>
    Re: What the **** is WRONG with this!? <tim@vegeta.ath.cx>
    Re: What's wrong with File::Find (Ian Boreham)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 25 Oct 2001 09:05:49 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: 'bash : *.gif' with regex, any nice idea ?
Message-Id: <hmkfttk9u16t4psvkga08d298vrh305pp7@4ax.com>

Laurent Stefan wrote:

>I'd like to simulate a 'bash reg' like : *.gif in regex.

I'm not exactly sure what you mean... You mean you want an equivalent
regex for this, er, glob?

The next snippet can turn any glob into an equivalent regex. I'm not
sure what you expect to happen with backslashes in the input; I here
take them literally.

	my $glob = '*.gif';
	my %replace =  ( '*' => '.*', '?' => '.' );
	(my $regex = $glob) =~ s/(\W)/$replace{$1} || "\\$1"/ge;
	$regex = "^$regex\$";
	print $regex;
->
	^.*\.gif$

-- 
	Bart.


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

Date: Thu, 25 Oct 2001 08:09:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: lookingglass.pl
Message-Id: <v3iftt0u7o0sionntp5dq0m1b317c4o0ra@4ax.com>

Martien Verbruggen wrote:


>for (0 .. $#array) { # Need the index here.  }
>
>for (0 .. @array - 1) { }

>I really think that there are valid uses of $#array. They are
>semantically different, as you explain later on. scalar @array gives
>you the number of elements, $#array gives you the last index. Use them
>in your code when you mean either of these.

But the above code examples both use 0 where you mean "the first item of
the array"!

-- 
	Bart.


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

Date: Thu, 25 Oct 2001 05:40:58 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: lookingglass.pl
Message-Id: <3BD7DE2A.91942793@earthlink.net>

Bart Lateur wrote:
> 
> Martien Verbruggen wrote:
> 
> >for (0 .. $#array) { # Need the index here.  }
> >
> >for (0 .. @array - 1) { }
> 
> >I really think that there are valid uses of $#array. They are
> >semantically different, as you explain later on. scalar @array gives
> >you the number of elements, $#array gives you the last index. Use
> >them in your code when you mean either of these.
> 
> But the above code examples both use 0 where you mean "the first item
> of the array"!

Are you suggesting that we use instead:
    for( $[ .. $#array ) { .... }

:~)

-- 
Klein bottle for rent - inquire within.


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

Date: Thu, 25 Oct 2001 08:55:40 GMT
From: lex@nospam.peng.nl (Lex Thoonen)
Subject: Re: matching
Message-Id: <3bd6eebd.84201623@news>

Then, completely unexpected, on Wed, 24 Oct 2001 15:25:29 GMT,
tadmc@augustmail.com (Tad McClellan) turned around and said:


>That will match:  contents of $key followed by zero or more dot chars.
>
>   eg.   19......jpg
>
>Is that what you wanted to match?
>

No!


>>
>>$key can be a number, 
>             ^^^^^^^^
>
>12.45
>
>1e10
>
>5+5
>
>Those are all "numbers" too. I will assume you mean "all digit characters"
>instead of "number".
>

I mean: only (whole) numbers (english is not my 1st language) like 1 2
3 etc. not: -1 or 1.5 or 1,5 or 0,3 or 0


>
>But below you seem to be indicating that $key can contain
>non-digit characters, so I don't know what you mean here.
>
>Did you mean the base part of the filename (ie. excluding the
>filename extension) can be only digit characters?
>

No. $key is for example 19  

the files I want to delete are: 19a.jpg or 19a.jpeg or 19a.gif or
19b.jpg or actually, 19 , followed by a letter than a dot than I don't
care

>>Any of these numbers can have images in a folder:
>
>>for example: 19a.jpg 19b.gif 19c.JpeG
>>
>>The problem is the a, b and the c
>>
>>What I would like this script to do is:
>>
>>check for all records that are 19 ($key) followed directly with a
>>letter. (so, don't take 191a.jpg for example)
>
>
>You have not specified what you need completely enough to
>give a definitive answer, so here is a WAG:
>
>   my @files = grep { /^$key[abc]\..*$/i } readdir(DIR);
>

I'll try this one,

Thanks!

Lex


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

Date: Thu, 25 Oct 2001 09:52:53 +0200
From: Mirko Schur <mschur@web.de>
Subject: Re: Need help to find a regexp
Message-Id: <3BD7C4D5.EF135A5D@web.de>

Hi jdcfan,

Thanks, that's a good one. Did not know about this
extended syntax for meta symbols like (?<!...) . Thanks a lot!

Mirko

-- 
Mirko Schur
http://www.mirkoschur.de
info@mirkoschur.de


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

Date: Thu, 25 Oct 2001 09:53:11 GMT
From: "Jippie@yahoo.com" <jippie@yahoo.com>
Subject: NEWBIE: double sort on a string
Message-Id: <biRB7.134495$2n1.5282969@Flipper>


Hi,

What I'm trying to do is to sort of on two columns.
The the first column is an argument and the second in always column 1.

This is what I have done but my logic is wrong.
I thought it would be just an extra check if both are the same then check if
column 1 are the same.

Jippie

sub by_string
{
 @parts_a=split(/[|]/,$a);
 @parts_b=split(/[|]/,$b);

 $retval = (lc($parts_a[$sortfield])) cmp (lc($parts_b[$sortfield]));
 if( $retval == 0 && $sortfield !=1 ) # they are the same
 {
  # then sort by title next. Always nice to have the title in order
  $retval = (lc($parts_a[1])) cmp (lc($parts_b[1]));
 }
}





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

Date: Thu, 25 Oct 2001 09:12:11 +0200
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7BB4B.730DD31D@web.de>



Tassilo von Parseval wrote:

> 
> Fourthly:
> http://www.ubka.uni-karlsruhe.de/cgi-bin/psview?document=/ira/2000/5
> 
> This is a lengthy comparison between C, C++, Java, Perl, Python, REXX
> and TCL. The tests were made back at 1998 so the JDK used was not
> up-to-date. Yet I doubt that a recent Java would have changed the
> results that significantly. The tendency would have been roughly the
> same (extravagant memory-consumption, rather poor runtime-performance).

I dont want to be harsh, but this assumption is simply worthless -
because you simply dont know it.

Performance is major item that is addressed in almost every 
release of a new JRE from SUN. Depending on your code it can
make a BIG difference if you are using JDK 1.1, JDK 1.2 with JIT,
JDK 1.3 with classical JIT or HotSpot, 1.4 beta with HotSpot ...

Therefore it is simply not fair to tell people: 'three years before
Java was very slow, I think there might be improvements but my guess
is "it is still slow" so forget it.'


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

Date: Thu, 25 Oct 2001 09:44:47 +0200
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7C2EF.E8699F12@web.de>

Just my two cents, that might be interesting (or not) because
I am in Java for years now and spent a lot of time during
the last months to come into perl.

Before I start: I am going to share my impressions - I do not
claim that those are really TRUE facts (in the sence that
100 % of the readers will agree in every point with me).

My first impression of perl was: "it is so damn ugly": There
are so many things incorporated into the language, there are
so many ugly things that you are allowed to do. 

But within days I saw that this allows you to do very 
powerful things "on the fly" that would need lines and lines
of code and hours and hours to do it in Java.

What I really like about Java is the thing that it comes with
so many standard libraries. Of course, you than have some 20 meg
or more just for the libraries on you machine ... but 
everything is there. You dont need to tell people: go to
something CPAN-alike and get lib X, lib Y, and lib Z.

When talking about JDK 1.4 I would say that 80% of the
stuff that you need in you order to write your applications
is already part of the distribution (meaning: if I write
100 programs, I wont need an additional lib for 80 of them). 
And all the documentation is so easy to use ... but of course 
you have megs and megs of stuff on your machine.

I also do prefer the way Java evolves. Its easier to 
participate in the "perl evolution" - just become a 
member of "perl 5 porters" and start to bring in your
ideas. But its harder to get information about the current
state of ideas (for example: 
* I want to know, what is the real state of threads in 
  perl - what do the decision makers think will happen 
  here? ... I have to go search through the mailing list ...
* With java, there is completely defined process. For
  each feature that is in discussion I cant easily find
  out in which state it is, when the next "decision point"
  will take place and so. Its harder (but still possible)
  to influence those process - but its easier to grep
  its current state.

My conclussion:
programming languages are tools. If perl has proven to
be the right tool for you - just keep it. If you are
going to write a 5 million LOC application with 20
programmers that should last for 10 years - better
take Java. 
Large projects DO need interfaces that are absolutely 
clear in their meaning. If a language allows you to
do "dirty things" people will start to use those 
features. That might be OK for small projects - but
in my eyes it is a clear "DON'T" in bigger projects.


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

Date: Thu, 25 Oct 2001 10:15:31 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7CA23.1020906@post.rwth-aachen.de>

Edwin Günthner wrote:

> Tassilo von Parseval wrote:
> 
> 
>>Fourthly:
>>http://www.ubka.uni-karlsruhe.de/cgi-bin/psview?document=/ira/2000/5
>>
>>This is a lengthy comparison between C, C++, Java, Perl, Python, REXX
>>and TCL. The tests were made back at 1998 so the JDK used was not
>>up-to-date. Yet I doubt that a recent Java would have changed the
>>results that significantly. The tendency would have been roughly the
>>same (extravagant memory-consumption, rather poor runtime-performance).
>>
> 
> I dont want to be harsh, but this assumption is simply worthless -
> because you simply dont know it.


What makes you so sure that I don't know? I have the jdk1.3.1 and the 
jdk1.4.0beta installed on my machine. Previously I had jdk1.2. The 
progress was there but I'd still say it was marginal. Programs written 
in Java were so far the only ones causing my OS to run out of memory. 
not even monsters such as Mozilla were able to achieve it. And, mark 
that, these were all rather programs of average complexity. There is 
something fundamentally wrong with Java and its internals.


> Performance is major item that is addressed in almost every 
> release of a new JRE from SUN. Depending on your code it can
> make a BIG difference if you are using JDK 1.1, JDK 1.2 with JIT,
> JDK 1.3 with classical JIT or HotSpot, 1.4 beta with HotSpot ...


But this does not address the core of the matter: Take into account that 
you can probably write programs in Perl that are dynamic to an extent 
that they can hardly be compiled so that the compilation runs as 
predictably as the interpreted script. This is a common thing with 
LISP-compilers that tend to alter the way a program originally behaved.
Compare ordinary Java to an ordinarily interpreted Perl-script and 
you'll get clear indications as to general differences in architecture. 
There may be JIT, but who knows whether there'll not be a 'real' 
Perl-compiler some day. What about the Parrot-machine that is currently 
developed?


> Therefore it is simply not fair to tell people: 'three years before
> Java was very slow, I think there might be improvements but my guess
> is "it is still slow" so forget it.'


My guess was towards this benchmark. But I am not guessing as far as 
Java in real-life is concerned.

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: 25 Oct 2001 03:17:35 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Perl Vs. Java
Message-Id: <9r8hqv$ikc$1@charity.cs.utexas.edu>

In article <3BD798BB.7040605@post.rwth-aachen.de>,
Tassilo von Parseval  <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>Logan Shaw wrote:

>> Oh my, the Java seems to be almost 20 times as fast as the Perl one!
>> Now, I love Perl, but that's a pretty significant speed difference.

>It only seems to be. First you did not tell us which platform you are 
>using. Java on a native Sun-machine is something quite different than on 
>a PC running Win or Linux.

That information actually was buried in my "perl -version" output, but
for the record it's Solaris 8 running on Athlon-based PC system.

>Secondly, you neglected memory consumption. Java is known to consume a 
>lot of that.

I added sleep(10) or moral equivalent to the very end of those same
programs, and ran the same test again, this time running "top" to
examine memory usage.  Here's what I found:

    Java:  26MB total process size, 7540K of that resident
    Perl:  42MB total process size, 41M of that resident
    C++:  2828K total process size, 2556K of that resident

Granted, this is something of a worst case for Perl -- an array of
elements that are only used to store true/false values.  Java and C++
both store the booleans as bytes[1], so if you consider only resident
size[2], it would appear that Java isn't too terribly wasteful in this
case.

Just for grins, here is how much memory each uses when I ask
it to operate on the interval [2,5] (i.e. virtually nothing):

    Java:   24MB total process size, 5236K of that resident
    Perl:  2236K total process size, 1408K of that resident
    C++:    876K total process size, 604K of that resident

In this, Java is the clear loser, although it helps to keep in mind
that Java does have a high fixed overhead because the Hotspot JVM is a
fairly complex thing.

>Thirdly, this was hardly a real life example. Let the programs do some 
>I/O for instance, or perhaps add a GUI to it and things wont be that 
>bright any longer for Java.

I certainly can't disagree with this.  It's definitely not a real-life
example.  Unfortunately, to make a real-life example that I can use to
compare the three requires much more time than I have right now.

>Fourthly:
>http://www.ubka.uni-karlsruhe.de/cgi-bin/psview?document=/ira/2000/5

I shall have to take a look at that at some point when I have more
time.  It looks quite extensive.

  - Logan

[1]  Actually, I think Java stores booleans as bytes if they're
     in an array and 32-bit quantities otherwise.  A little bit
     strange, but it makes sense in a weird way too.

[2]  I assume the Java process image is so large because it loads
     classes by using mmap() on them as a way of loading lazily,
     although this is sort of just a guess.  At any rate, it is
     interesting that the resident portion of the process never
     got very large in comparison to the total size.
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


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

Date: Thu, 25 Oct 2001 10:24:25 +0200
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7CC39.F5FD858C@web.de>



Tassilo von Parseval wrote:
> 
> What makes you so sure that I don't know? I have the jdk1.3.1 and the
> jdk1.4.0beta installed on my machine. Previously I had jdk1.2. The

Sorry, maybe it was just a misunderstanding - i interpreted your words
as "i am guessing that ..."

> progress was there but I'd still say it was marginal. Programs written
> in Java were so far the only ones causing my OS to run out of memory.
> not even monsters such as Mozilla were able to achieve it. And, mark

Wait a second - was your OS running out of memory or was it that
your Java program told you: "not enough memory"? Thats happens
sometimes because the JVM is running with a fixed upper boundary
of memory. Therefore a Java appliation might run out of memory
although there would be more memory available on that machine.

In java newsgroups "my program is running out of mem" is almost a 
FAQ - and when you tell people: tell the JVM to start with more
MAX heap size - they do so and are happy afterwards.

> There may be JIT, but who knows whether there'll not be a 'real'
> Perl-compiler some day. What about the Parrot-machine that is currently
> developed?

Saying "java isnt that slow" has no relation to the speed of perl.
My concern was not to do a comparison here.

> My guess was towards this benchmark. But I am not guessing as far as
> Java in real-life is concerned.

OK.


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

Date: Thu, 25 Oct 2001 10:33:28 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7CE58.7030406@post.rwth-aachen.de>



Edwin Günthner wrote:

> 
> Tassilo von Parseval wrote:
> 
>>What makes you so sure that I don't know? I have the jdk1.3.1 and the
>>jdk1.4.0beta installed on my machine. Previously I had jdk1.2. The
>>
> 
> Sorry, maybe it was just a misunderstanding - i interpreted your words
> as "i am guessing that ..."
> 
> 
>>progress was there but I'd still say it was marginal. Programs written
>>in Java were so far the only ones causing my OS to run out of memory.
>>not even monsters such as Mozilla were able to achieve it. And, mark
>>
> 
> Wait a second - was your OS running out of memory or was it that
> your Java program told you: "not enough memory"? Thats happens
> sometimes because the JVM is running with a fixed upper boundary
> of memory. Therefore a Java appliation might run out of memory
> although there would be more memory available on that machine.


The latter. But I set the upper boundary to 128meg with the -Xms switch. 
Mind you, a not so complex program should be able to run with 128meg. ;-)

 
> In java newsgroups "my program is running out of mem" is almost a 
> FAQ - and when you tell people: tell the JVM to start with more
> MAX heap size - they do so and are happy afterwards.


Some are, some are not. :-)

But that's a good test:
Run a Perl-program and see how much memory it eats up at most. Now run 
the Java-equivalent with this much memory + 2meg (just for making sure). 
  I assume it'll throw an OutOfMemoryException sooner or later.


>>There may be JIT, but who knows whether there'll not be a 'real'
>>Perl-compiler some day. What about the Parrot-machine that is currently
>>developed?
>>
> 
> Saying "java isnt that slow" has no relation to the speed of perl.
> My concern was not to do a comparison here.


Actually we had been generalizing a little too much. Java really suns 
smoothly on a decent Sun under Solaris, because that's a machine 
explicitely optimized for Java. Additionally, it is said to run quite 
well server-wise (JSP etc).
I think it is (in parts) also true for Perl. I experienced better 
performance under UNIX-alike OSs while it all felt slightly sluggish on 
the same computer running Win.


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: Thu, 25 Oct 2001 10:52:35 +0200
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7D2D3.9CB5E0EE@web.de>



Tassilo von Parseval wrote:

> The latter. But I set the upper boundary to 128meg with the -Xms switch.
> Mind you, a not so complex program should be able to run with 128meg. ;-)

On the other hand - I created many many not so complex programs in my
Java career - I almost never ever had to use -Xms in order to run them.

> But that's a good test:
> Run a Perl-program and see how much memory it eats up at most. Now run
> the Java-equivalent with this much memory + 2meg (just for making sure).
>   I assume it'll throw an OutOfMemoryException sooner or later.

Thats doesnt sound very logical: a bugfree program will not need more
memory just because it running for 2 hours instead of 20 minutes. 

If your Java programs do need more and more memory over time ... 
well that sounds like you are very good in implementing java memory 
leakes (what is a difficult but doable task).

;-)

> Actually we had been generalizing a little too much. Java really suns

Ack.


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

Date: Thu, 25 Oct 2001 10:57:53 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Perl Vs. Java
Message-Id: <3BD7D411.4020404@post.rwth-aachen.de>

Logan Shaw wrote:


[...]

>>It only seems to be. First you did not tell us which platform you are 
>>using. Java on a native Sun-machine is something quite different than on 
>>a PC running Win or Linux.
>>
> 
> That information actually was buried in my "perl -version" output, but
> for the record it's Solaris 8 running on Athlon-based PC system.


Indeed, I oversaw the compiled for stuff.


>>Secondly, you neglected memory consumption. Java is known to consume a 
>>lot of that.
>>
> 
> I added sleep(10) or moral equivalent to the very end of those same
> programs, and ran the same test again, this time running "top" to
> examine memory usage.  Here's what I found:
> 
>     Java:  26MB total process size, 7540K of that resident
>     Perl:  42MB total process size, 41M of that resident


Almost to the byte identical with my results.


[...]

> Just for grins, here is how much memory each uses when I ask
> it to operate on the interval [2,5] (i.e. virtually nothing):
> 
>     Java:   24MB total process size, 5236K of that resident
>     Perl:  2236K total process size, 1408K of that resident
>     C++:    876K total process size, 604K of that resident
> 
> In this, Java is the clear loser, although it helps to keep in mind
> that Java does have a high fixed overhead because the Hotspot JVM is a
> fairly complex thing.


Yes, the famous overhead. I just did the same sort of benchmark on my 
machine (Debian, also an Athlon, so CPU probably comparable):

ethan@ethan:~$ time ./test.pl 2000000
There are 148933 primes in the interval [2,2000000].

real   0m25.964s
user   0m25.870s
sys    0m0.090s
ethan@ethan:~$ time /usr/local/jdk1.3.1/bin/java Sieve 2000000
There are 148933 primes in the interval [2,2000000].

real   0m2.079s
user   0m1.980s
sys    0m0.060s

Quite interesting since we almost have identical time for the 
Java-program while my Perl script is more than 10 secs quicker than on 
your machine. That shows us that performance is a a remarkably 
platform-dependent matter.


[...]

>>Fourthly:
>>http://www.ubka.uni-karlsruhe.de/cgi-bin/psview?document=/ira/2000/5
>>
> 
> I shall have to take a look at that at some point when I have more
> time.  It looks quite extensive.


It is. And unfortunately testing jdk1.2.


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: Thu, 25 Oct 2001 08:34:02 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl, MySQL, MS Access, Windows AND Linux
Message-Id: <i2jfttgajqr88hb8bv8mp38or52ogfudm5@4ax.com>

[comp.lang.perl snipped, as it is dead -- and supposed to stay that
way.]

Rubber Ducky wrote:

>Is it possible to interact with both MySQL AND MS Access at the same time
>with Perl?  I want it to run on both on windows and on linux. Could you
>please provide SOME details of how I can acomplish such a thing!

Yes it's possible, at least on Windows, with DBI and DBD::ODBC for
Access, DBD::mysql for MySQL. Take any standard DBI sample program, and
provide two database handles, each connecting to a different database.
There. You have access to two different databases in one program, at the
same time.

For Linux, in addition, you have the problem of connecting to an Access
database. There's no program in the world (that I know of) that can
directly manipulate an Access database file on Linux. It is possible, in
several ways, to connect to a Windows machine which contains, and
connects to the database. For example, DBD::Proxy is one way you can do
it (which I still haven't tested, I must say). See that link on the DBI
homepage: <http://dbi.symbolstone.org>


-- 
	Bart.


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

Date: Thu, 25 Oct 2001 03:54:54 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Regexp help needed Part 2
Message-Id: <3BD7C54E.BCF5A9B7@earthlink.net>

DIAMOND Mark R. wrote:
> 
> I am back. Sorry.
> 
> The solution given to me by Bernard El-Hagin works wonderfully, but I
> realise I made two omissions which complicate things although, in a
> list of over 1000 references, the problem only arises about 15 times
> ... certainly easy enough to correct manually. But here is the problem
> anyhow.
> 
> Initials, strange as it may seem, are not ALWAYS uppercase. One
> occasionally gets an Authorship like "von Erich von Holst and David
> Mittelstaedt" where the whole reference then becomes
> 
> \item von Holst, v. E., & Mittelstaedt, D. (1954).
> Also I did not include the title stuff that appears on the rest of
> the. Journal Name and other stuff.
> 
> So, is there a way of making the processing stop for a line at the
> appearance of the parenthesised year. One can then replace the [A-Z]
> with [a-zA-Z] and get the correct result? The complication then seems
> to be that one can't use the very useful "global"

while( <FILE> ) {
    substr( $_, 0, index( $_, " (" ) )
        =~ s/(\b[a-zA-Z]\.) /$1\\ /g;
    s/&/~\\&/g;
    print;
}

-- 
Klein bottle for rent - inquire within.


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

Date: Thu, 25 Oct 2001 08:37:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: syntax help?
Message-Id: <7njftt8ovkravgk5hikg7dvl39937gafqp@4ax.com>

Steve in Phx wrote:

>add:filename.suf
>add:myoraprc.prc  ds01,p3shr;ds01,p3hmr;ds01,p3wye
>
>I want to modify it to read in one more "server" field as a variable in the
>"add:" line, like this:

>add:server:filename.suf
>addserver::myoraprc.prc  ds01,p3shr;ds01,p3hmr;ds01,p3wye

Do you want "add:server" or "addserver"? Anyway, this is the basis of
what you want to achieve:

	s/^add:/addserver:/

If your data is all one big string, add the /m and /g modifier. On a
line by line basis, you don't need these.

-- 
	Bart.


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

Date: Thu, 25 Oct 2001 09:24:33 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: What the **** is WRONG with this!?
Message-Id: <slrn9tfne8.813.tim@vegeta.ath.cx>

Me parece que Philip Newton <pne-news-20011025@newton.digitalspace.net> dijo:
>  On 24 Oct 2001 04:56:46 GMT, "David H. Adler" <dha@panix.com> wrote:
> > In article <Xns9143D27FBA15615497002270367234@24.2.10.79>, Graham W.
> > Boyes wrote:
> > 
> > > Aren't newsgroups great? If you need a computer hardware question or
> > > networking question answered, feel free to visit
> > > 24hoursupport.helpdesk.
> > 
> > And, *boy*, don't we wish there was such a hierarchy for us to send
> > people to!  :-)
>  
>  Well, there's alt.dev.null ....
>  
>  (Which my news server will not let anyone post or followup to.)

Ironic.  Maybe there should be a similar group in the microsoft
hierarchy.  Like comp.os.msdos.NUL; they could use this as an alias for
other newsgroups.

#define TRASH "comp.os.msdos.NUL"
symlink(TRASH, "comp.os.ms-windows.complaints");
symlink(TRASH, "comp.os.ms-windows.features.requests");
symlink(TRASH, "comp.os.ms-windows.bugs.patches");
symlink(TRASH, "comp.os.ms-windows.help");
symlink(TRASH, "comp.os.ms-windows.where.the.f***.is.the.documentation");

Good think Windows doesn't have symlinks.

Tim
-- 
And now for something completely different.


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

Date: 25 Oct 2001 01:40:31 -0700
From: ianb@ot.com.au (Ian Boreham)
Subject: Re: What's wrong with File::Find
Message-Id: <f02c4576.0110250040.ed266a1@posting.google.com>

Dave Tweed <dtweed@acm.org> wrote in message news:<3BD74A01.C3A62D5B@acm.org>...
> Mark Jason Dominus wrote:
> > >find(sub { mysub(@myargs) }, '/', '/tmp');
> > 
> > It has the same effect because it is the same suggestion.  You are
> > using a closure, as Alexander suggested.
> 
> Not all anonymous subs are closures. In this case, there's no binding
> to a lexical variable outside any caller's scope; @myargs is passed
> by value.

If @myargs is a lexically scoped variable when the anonymous sub is
created, then you have a closure. What the anonymous sub does with it
(passing it by value) doesn't affect this.

Either this represents a closure (if the above is true), or @myargs is
a global variable, both of which the OP suggested (but apparently
didn't like, for no stated reason). This seems like an ideal use of
closures to me. I'm not so keen on the globals.

Regards,


Ian


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

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


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