[10205] in Perl-Users-Digest
Perl-Users Digest, Issue: 3798 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 23 12:07:24 1998
Date: Wed, 23 Sep 98 09: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 Wed, 23 Sep 1998 Volume: 8 Number: 3798
Today's topics:
1st Sunday of each Month <hyacinth@bellsouth.net>
bi-directional on NT ihomebrew@my-dejanews.com
Code Included: HOWTO? (David Collantes)
Re: Code Included: HOWTO? (David Collantes)
compiler vs interpreter (Re: any way to encrypt my scri (Paul David Fardy)
date::manip and GMT/localtime (Steve .)
Re: Hashes springing into existence [Was: more regex/pa <dgris@rand.dimensional.com>
Re: Learning Perl Advice <eashton@bbnplanet.com>
Re: Learning Perl Advice <murrayb@vansel.alcatel.com>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <samiller@BIX.com>
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl and Oraperl <eashton@bbnplanet.com>
Perl, SWIG, CORBA? <apollo@uni-paderborn.de>
question about variable interpolation in search pattern <rann@bbn.com>
Rotating an array. <ckc@dmi.dk>
Re: Rotating an array. <ajohnson@gpu.srv.ualberta.ca>
Re: until problem (M.J.T. Guy)
Re: Virtual Memory Question <eashton@bbnplanet.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Sep 1998 15:27:58 GMT
From: "Stafford Hyacinth" <hyacinth@bellsouth.net>
Subject: 1st Sunday of each Month
Message-Id: <2s8O1.903$_G3.853152@news2.mia.bellsouth.net>
Anyone has sample code for figuring out the 1st sunday of each month or at
least give an idea where to begin. Have been going at this for two days and
still have no code. If I could only do vbscripts on the UNIX platforms.
Thanks
Stafford Hyacinth
hyacinth@bellsouth.net
------------------------------
Date: Wed, 23 Sep 1998 15:08:50 GMT
From: ihomebrew@my-dejanews.com
Subject: bi-directional on NT
Message-Id: <6ub2u2$jid$1@nnrp1.dejanews.com>
Using some of the examples posted here and on the web I wrote the following
bi- directional script which works fine on Unix but IPC::Open3 fails on NT.
Is there a suitable alternative for NT or is there a way to restructure my
script to work on both platforms?
Thanks... CDR
Clark Ritchie
cdr@cinap.com
#!/usr/bin/perl
use FileHandle;
use IPC::Open2;
STDOUT->autoflush(1);
# external Java program that provides input
$sender = open2( \*SENDER_READ, \*SENDER_WRITE, 'java Sender') or die 'Unable
to open2 Sender';
SENDER_READ->autoflush(1);
SENDER_WRITE->autoflush(1); # not used
# external Java program that receives input (and does output to a file)
$receiver = open2( \*RECEIVER_READ, \*RECEIVER_WRITE, 'java Receiver') or die
'Unable to open2 Receiver';
RECEIVER_READ->autoflush(1); # not used
RECEIVER_WRITE->autoflush(1);
while(1) {
#print "\nReading from SENDER_WRITE";
while( $line = <SENDER_READ> ) {
break if $line -~ m/end/i;
print "Read line is: $line";
print RECEIVER_WRITE $line or die "unable to write to
SENDER_WRITE";
}
}
exit 0;
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 23 Sep 1998 15:09:45 GMT
From: david@atlantis.bus.ucf.edu (David Collantes)
Subject: Code Included: HOWTO?
Message-Id: <6ub2vp$814$1@news.cc.ucf.edu>
Keywords: Perl, Next Page, Previous Page
Hi there!.
The code below is a simple CGI program that will read from a flat text
file/database and print the matching results. What I am looking for is to
be able to "break" the results on groups of 5 or 10, when I get, lets say,
more than 5 or 10 match returns. How that can be achieve, without
performing major modifications on the code?. I am not really looking for a
complicated code, just a simple one, but with this feature. Anyone has a
sniplett that can be adapted to do this task?. Anyone willing to write it
for me?.
Please, any help would be highly appreciated. I am willing to pay a modest
ammount for that piece of code.
Kindly redirect your help/tips to david@bus.ucf.edu.
Thanks in advance,
-
David Collantes
University of Central Florida. Orlando, FL, U.S.A.
-
------------------------------
Date: 23 Sep 1998 15:19:12 GMT
From: david@atlantis.bus.ucf.edu (David Collantes)
Subject: Re: Code Included: HOWTO?
Message-Id: <6ub3hg$824$1@news.cc.ucf.edu>
I wrote:
: The code below is a simple CGI program that will read from a flat text
: file/database and print the matching results. What I am looking for is to
: be able to "break" the results on groups of 5 or 10, when I get, lets say,
: more than 5 or 10 match returns. How that can be achieve, without
: performing major modifications on the code?. I am not really looking for a
: complicated code, just a simple one, but with this feature. Anyone has a
: sniplett that can be adapted to do this task?. Anyone willing to write it
: for me?.
: Please, any help would be highly appreciated. I am willing to pay a modest
: ammount for that piece of code.
: Kindly redirect your help/tips to david@bus.ucf.edu.
I forgot to attach the code. Here it is:
###
# BEGINING OF THE CODE
###
sub GET_STATE_INFO {
read(STDIN, $save_string, $ENV{CONTENT_LENGTH}); # Yes- Use it
@prompts = split(/&/,$save_string);
foreach (@prompts)
{
($tmp1, $tmp2) = split(/=/,$_);
$tmp2 =~ s/\x2b/\x20/g;
$tmp2 =~ s/%2C/\x2c/g;
$tmp2 =~ s/%28/\x28/g;
$tmp2 =~ s/%29/\x29/g;
$tmp2 =~ s/%40/\x40/g;
$fields{$tmp1}=$tmp2;
}
$keys = $fields{'keys'};
$search_type = $fields{'search_type'};
}
sub SEARCH_FOR_MATCH {
@search_key = split(/\x20/,$keys);
open(DATAFILE,"phone_directory") || print "Error: Can not open phone book file";
while(<DATAFILE>)
{
$in_line = $_;
if ($search_type eq "and")
{ $found_flag = "Y"; }
else
{ $found_flag = "N"; }
foreach (@search_key)
{
if ( $in_line =~ m/$_/i)
{
if ($search_type eq "or")
{
$found_flag = "Y";
last;
}
}
else
{
if ($search_type eq "and")
{
$found_flag = "N";
last;
}
}
}
if ( $found_flag eq "Y" )
{
$counter_var++;
$in_line = $_;
($email, $name, $phone_num, $dep ) = split(/,/,$in_line);
print "<TD ALIGN=\x22center\x22>", $name, "</TD>\n";
print "<TD ALIGN=\x22center\x22>", $phone_num, "</TD>\n";
print "<TD ALIGN=\x22center\x22>", $email, "</TD>\n";
print "<TD ALIGN=\x22center\x22>", $dep, "</TD>\n";
print "<TR>\n";
$counter_var++;
if ( $counter_var > $max_hits) { last; }
}
}
}
$max_hits = 100;
$counter_var = 0;
print("Content-Type: text/html\n\n");
print("<HEAD><TITLE>Results</TITLE></HEAD>\n");
print("<BODY>\n");
&GET_STATE_INFO;
print "<H1>Phone Directory Look Up</H1>\n";
print "<P>Enter Search terms seperated by spaces. \n";
print " Search terms can be Name, Phone Number, Email, or Department";
print "<FORM METHOD=POST ACTION=phone.cgi>\n";
print "<INPUT TYPE=\x22text\x22 NAME=\x22keys\x22 SIZE=40 ";
print " VALUE=\x22", $keys, "\x22>\n";
print "<BR>Select Search type: \n";
print "\n<INPUT TYPE=\x22radio\x22 Name=\x22search_type\x22 VALUE=\x22and\x22";
if ($search_type eq "and" || $search_type eq "" ) { print " CHECKED"; };
print "> AND";
print "\n<INPUT TYPE=\x22radio\x22 Name=\x22search_type\x22 VALUE=\x22or\x22";
if ($search_type eq "or" ) { print " CHECKED"; };
print "> OR";
print "\n<INPUT TYPE=\x22submit\x22 Name=\x22submit\x22 Value =\x22Search\x22>\n";
print "\n</FORM>\n";
if ( $keys eq "")
{
print "<HR>";
print " Note: \x22OR\x22 search finds lines that match any search terms.";
print " \x22AND\x22 search finds lines that match all search terms.";
}
else
{
print "<HR>";
print "<B>Search Results</B>";
print "<TABLE BORDER>\n";
print "<TH ALIGN=\x22center\x22>Name</TH>\n";
print "<TH ALIGN=\x22center\x22>Phone Number</TH>\n";
print "<TH ALIGN=\x22center\x22>Email Address</TH>\n";
print "<TH ALIGN=\x22center\x22>Department</TH><TR>\n";
&SEARCH_FOR_MATCH($keys);
if ($counter_var > $max_hits )
{
print "<TD ALIGN=\x22center\x22><B>Limit of ", $max_hits;
print " matches exceeded.</B></TD>\n";
print "<TR>\n";
}
print "</TABLE>\n";
}
###
# END OF THE CODE
###
A test file would be:
CUT HERE---------------------------------------------
STEVESMITH@BOGUS.COM,STEVE SMITH,999-555-1234,SALES,
GEORGEJONES@BOGUS.COM,GEORGE JONES,999-444-5689,SALES,
JOHNSMITH@FOO.COM,JOHN SMITH,999-555-2345,PROGRAMMING,
ALEXJONES@BOGUS.COM,ALEX JONES,999-555-1122,MARKETING,
JOHNJONES@FOO.COM,JOHN JONES,999-555-3322,PROGRAMMING,
PAULSMITH@BOGUS.COM,PAUL SMITH,999-333-1122,PAYROLL,
CUT HERE---------------------------------------------
I am sorry about my mistake and reposting.
-
David Collantes
University of Central Florida. Orlando, FL, U.S.A.
-
------------------------------
Date: 23 Sep 1998 15:23:25 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: compiler vs interpreter (Re: any way to encrypt my script?)
Message-Id: <6ub3pd$6q3$1@coranto.ucs.mun.ca>
Paul David Fardy <pdf@morgan.ucs.mun.ca> wrote:
>> Still, though, the technical issue is interesting: While it's true
>> that the */bin/perl we all know--and most here love--does compile the
>> code, is that a requirement of the language? How hard would be for
>> some random perl programmer--say Larry Wall, for example--to write
>> a perl program that interprets perl programs?
abigail@fnx.com (Abigail) writes:
> It's already there. It's called "eval".
That was my first thought, but I thought we wanted to be truly pure
here. A program might consist of a single eval, but I feel that's
too close to just calling perl an interpreter (a la #!/bin/perl).
And a series of blind "eval"s might be considered impure.
For example, wouldn't
eval "sub foobar { ... }"
create persistent compiled bytecode?
I suggest we use persistence as a benchmark for distinguishing a
compiler from an interpreter. If a translated version of the code
persists then the code has been compiled, else it's interpreted.
From the perspective of the Unix process hierarchy, only the Perl
source exists before the process runs and only the Perl source
exists after the process exits. From this point of view, Perl is
interpreted. Within the "PP interpreter"[1], Perl code is compiled
into byte-code. Using persistence as a benchmark, one might say:
Perl programs are interpreted, Perl code is compiled.
[1] Tom Christiansen, ``FMTEYEWTK about Compilation vs Interpretation
in Perl'', comp.perl.lang.misc, June 1996.
cf. http://www.perl.com/CPAN-local/doc/FMTEYEWTK/comp-vs-interp.html
Paul Fardy
--
Paul David Fardy | pdf@morgan.ucs.mun.ca
Computing and Communications | pdf@InfoNET.st-johns.nf.ca
Memorial University of Newfoundland |
St. John's, NF A1C 5S7 |
------------------------------
Date: Wed, 23 Sep 1998 15:56:19 GMT
From: syarbrou@ais.net (Steve .)
Subject: date::manip and GMT/localtime
Message-Id: <36091a17.1613223@news.ais.net>
Has anyone used Date::Manip to convert GMT to localtime? If so, how
do you go about doing that? Thanks a bunch.
Steve
------------------------------
Date: Wed, 23 Sep 1998 15:53:28 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Hashes springing into existence [Was: more regex/pattern substitution]
Message-Id: <6ub4l8$a7g$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <906514839.26393@thrush.omix.com>
Zenin <zenin@bawdycaste.org> wrote:
>Daniel Grisinger <dgris@perrin.dimensional.com> wrote:
<snip>
>: This is moderately annoying, but I'd imagine that fixing it
>: would break a lot of things (not to mention that fixing it
>: would almost certainly slow C<exists> way down).
>
> It should speed it up I'd think.
It doesn't seem so to me, but I may be misunderstanding
something about the perl core (if I am, I'd appreciate
if someone could enlighten me :-).
> If $foo{bar} does not exist we currently have:
>
> -Detect $foo{bar} does not exist
> -Create $foo{bar}
> -exists() on $foo{bar}{baz}
> -return
This makes sense as a mental picture, but it doesn't seem
that this is the way that perl actually works.
> Fixing this would give us:
>
> -exists() on $foo{bar}
> -return
After playing with it for a while last night, it looks like
the sequence is actually-
exists $foo{bar}{baz}; # assume $foo{bar} doesn't exist
newHV
newSV(foo)
rv2hv
newSV(bar)
rv2hv
pp_exists(baz)
or
exists $foo{bar}{baz} # assume $foo{bar} does exist
rv2hv(foo)
rv2hv(bar)
pp_exists(baz)
Now, it's obvious that more steps are called when $foo{bar}{baz}
doesn't exist, but this is actually irrelevant because even
if it does exist the calls to newHV and newSV had to take
place at some point (ie, calling exists on only existing
values speeds up execution of exists, but has no effect
on total program execution).
In other words, pp_exists isn't called for each level of
in the hash, only for the final level. My statement that
not autovivifying in this case would slow things down
was based on the assumption that adding a call to pp_exists
at each level would introduce unacceptable overhead.
> If it's deeper, the same thing happends for each level. So,
> the question is which is faster, simple exists(), or
> autovivification? Since autovivification implies exists() at
> each level already, I'd bet exists() would be faster, regardless
> of the depth.
As I demonstrated above, even though autovivification may
imply exists() that doesn't mean that it happens. pp_exists
is only called for the last level. Adding it to each level
would almost certainly be a loss.
And this doesn't consider two other points that seem to be
important.
First, I'd expect (but may be wrong) that most of the
time when one says-
exists $foo{bar}{baz}{quux}{qiix}{qoox}
that at least $foo{bar}{baz}{quux}{qiix} exists. If this
is the case then every attempt to call exists adds a
huge amount of overhead if it is applied to each level
of the hash.
The second real problem that I see with calling exists
for each level is dealing with constructs such as-
exists $foo -> {bar} -> {baz} -> [$some_index] -> {quux}
Currently, pp_exists doesn't work on non hash references, so
to make this work you'd have to add code to check each level
before the hypothetical call to exists to make sure that
what was being looked at wasn't an array reference.
All in all, it seems to me that adding exists() for each
level would probably not be a good thing.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the
ending, but it still kind of surprised me.'
David Hatunen, talking about the movie Titanic
------------------------------
Date: Wed, 23 Sep 1998 15:02:22 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Learning Perl Advice
Message-Id: <36090B13.2CD7BF11@bbnplanet.com>
http://www.ora.com
http://www.perl.com
O'Reilly is simply superb and won't take 2,000 pages or 21 days to tell
you what you need to know. They choose the best in the field and have
wonderful editors. They even have held the Perl Conference two years in
a row. And I must admit, I really love the animals on the covers :) My
camel is always on my desk at work.
Don't go astray with Sams or some other '21 day' or 'complete'
publisher. I'll have to send you my ancient copy of the Llama if you do.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: 23 Sep 1998 07:48:58 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Learning Perl Advice
Message-Id: <uemt2opet.fsf@vansel.alcatel.com>
hex@voicenet.com (Matt Knecht) writes:
> Jonathan Feinberg <jdf@pobox.com> wrote:
> >It really depends on your learning style. I'll wager that most of the
> >Perl hackers around learned Perl from the O'Reilly book _Learning
> >Perl_, which is now in its second edition.
>
> I'll take that bet. I'm placing my money on the online docs, with
> _Programming_Perl_ as a side companion.
I'll side in this camp provided there's plenty of existing Perl to hack
around with. To that end I'd throw in the Perl Cookbook if you're not
in an environment with some pre-existing code. I did not find Learning
Perl to be particularly useful, and have not seen good results from
new Perl writers since we bought several copies of the book.
It's nice to have someone around who already knows the ropes, too.
--
Brad Murray "Be very, very careful what you put into that
Alcatel Canada head, because you will never, ever get it out."
Software Analyst (Cardinal Wolsey)
------------------------------
Date: Wed, 23 Sep 1998 15:12:42 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <Kd8O1.1565$Ge.5138098@ptah.visi.com>
In comp.lang.java.programmer Zenin <zenin@bawdycaste.org> wrote:
: George Reese <borg@imaginary.com> wrote:
: : In comp.lang.java.programmer Zenin <zenin@bawdycaste.org> wrote:
[a bunch of unsupported and ridiculous personal attacks on me deleted]
: : : So basically, if one is using language Foo and comes to a problem
: : : that is best solved with the paradigm of language Bar, that it is
: : : best to create a workaround kluge using only Foo's paradigm?
: : : best to create a workaround kluge using only Foo's paradigm?
: :
: : This is a silly question because you should determine your language
: : based on the requirements of your system. So if your problem requires
: : paradigm A, you use a language that supports paradigm A. If it
: : instead requires paradigm B, you use a language that supports paradigm
: : B.
: :
: : How hard is this principle for you to understand?
: So, basically you are completely ignoring any and all possibility
: that an application might be large and complex enough that different
: parts of it may require different paradigms. Or are you saying that
: such systems should be built in a dozen different languages to
: correctly match the dozen different paradigms that may be required?
: This is a completely false notion. In fact, the more complex a
: given problem the *greater* the likelihood that multiple paradigms
: will be required.
: How hard is this principle for you to understand?
A large and complex system may require at most one paradigm outside
the OO realm because, while OO is not everything, it does solve a
great percentage of problems. In systems where two paradigms are
required, you should use two languages.
: : : What if Java had closures. Would it be "wrong" to actually use them?
: : : Or would Java some how be less of a language for even supporting
: : : such a paradigm?
: :
: : Java has method pointers. A similar concept that does work in an OO
: : paradigm.
: Java has no method pointers, only interfaces and inner classes.
: Neither are not the same as closures, although they can be used
: as kluges for similar effects albeit with less power and "freedom".
Yes, java.lang.reflect allows you to dynamically reference methods and
call them. I did not say they were the same as closures, but they are
similar--they just work within an OO framework.
: : : Oh, you've been quite explicit. There is no need to read anything
: : : into your statements as you've made yourself quite clear.
: :
: : Then please quote them.
: I will not repost entire articles that are commonly available
: on DejaNews, and pulling out the interesting quotes even with
: message ID references simply will result in more, "that's out
: of context" whining.
Because you cannot find them. Either post something are shut the fuck
up.
: : I said that OO's weakness lies in performance of speed critical
: : systems. That implies that I think an OO programming approach is bad
: : for such systems. That does not imply those are the only systems for
: : which such an approach is bad.
: Ok, lets cut to the chase. Please tell us, *exactly* the list
: of system types or whatever for which you think OO is bad. If
: you don't want people to "extent your words into an extremist
: state", then stop playing these childish semantic games and
: be *explicit* in the extreme.
No one has asked for an enumeration of my perception of OO weaknesses
until now. So why would I have ever bothered to go into an
enumeration?
Clearly, programming in an OO language is inappropriate for
performance critical systems as OO languages (today) carry too much
overhead. C++ may be viable for some such systems.
An OO approach is inappropriate on a large project where no one on the
team has any OO experience (meaning they have not used it improperly.
An OO approach is not proper when a deadline is an overriding concern
for a team that is not very experienced in OO (this should read: a new
technology or methodology should not be used on projects with tight
deadlines).
An OO approach is not proper on a small, isolated project with no
future.
An OO approach is not proper for someone's pet systems.
I think that covers it, though there might be other systems where OO
is not appropriate.
: : By the way, how many exceptions do I have to give you before you stop
: : assigning me the extremist position?
: When you stop contradicting yourself, I'll think about it.
I haven't. And what is worse, you are unable to provide an example of
me contradicting myself exception in the one mistake I made regarding
algorithms.
See, if nothing else, I have shown I can admit when I am wrong. You,
on the other hand, just hold on to a position until you look like a
fool.
: : Or better yet, would you like to provide an example of an application
: : for which OO is not appropriate on technical merits not related to
: : performance?
: Most application servers. Actually, they are commonly best
: handled in a mix of OO and procedural code. Mainly a procedural
: socket handling, access control, and request brokering outer
: loop over OO request handlers.
: Statistic parsers, for similar reasons above.
: Databases, even "OO databases", for similar reasons above.
: etc...
I don't agree with any of these. Can you possibly be bothered to
provide support for these assertions?
: This is not a performance issue, it is simply the fact that the
: main core of the application simply goes from point A to point
: B, dispatches as yet unknown point C, then returns to finish up
: with point D, always. A very, very common system that gains nothing
: by sticking the main control loop inside a method of an object
: that will never call anything else. To do so would be to program
: in a procedural fashion within an OO framework, as well as simply
: be silly in many cases.
No, it wouldn't. This looks like a conceptual barrier on your part.
These systems are made up of objects that behave in certain ways.
Ideal candidates for OO programming.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: 23 Sep 1998 15:15:25 GMT
From: <samiller@BIX.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ub3ad$g7j@lotho.delphi.com>
Very true. However, "worrying about A" and "knowing about A" should not be
regarded as equivalent. Complete ignorance of "A" and its function can be
a limiting factor in the use of the tool in which it is embodied.
On 20 Sep 1998 09:46:26 PDT Patricia Shanahan of Who? Me? Organized? wrote
this re Re: Perl && Java - differences and uses:
>3. A stops being a everyday part of programming, and the size and
>difficulty of programs that are considered writable is increased so
>that programming is right at the limit of what programmers can do,
>even without having to worry about A.
Scott A. Miller
samiller@bix.com samiller@cyberenet.net
Have a new Java product? Annouce it @ www.javalobby.org/javawire
------------------------------
Date: Wed, 23 Sep 1998 11:28:03 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <36091383.17415B65@min.net>
George Reese wrote:
>
> Zenin <zenin@bawdycaste.org> wrote:
> : With the exception of the last few
> : posts from you, the only thing you have done throughout this entire
> : thread is prove yourself a zealot.
>
> No, you have tried to characterize me as such. You don't have the
> first bit of evidence to back up that characterization.
All the evidence resides in a globally accessible repository.
It is a mere excercise to cut and paste samples from it.
> : Your own assertions do not equal "support".
>
> In fact, they do. You can argue with those assertions. But a
> supported argument is one in which the premises lead to the
> conclusion. I have provided premises that do lead to my conclusion.
>
> You can argue the premises, but you cannot argue that I have failed to
> provide support.
I can and will.
Given: A & B => C
Which is to say: A and B implies C
Or: if A and B then C.
This is a statement in propositional logic, which complete and
consistent.
Now if I claim that C is true, and as "support" I also claim that
A and B are true, I really have done nothing to validate my claim
that C is true, unless I also demonstrate that A and B are true.
This is not necessarily difficult; for example, I could find
a way of reducing A and B to tautologies.
In any case, your C is unsupported because of the very fact that your
A and B are unsupported. Your logical framework has no underpinning.
(Or, if it does, you haven't provided it in this forum.)
> Read it in the original context. While I can
> understand the confusion on this issue, I believe John even
> agrees with me that what I claim now is what I meant then and he
> brought this quote up.
What I am "agreeing with" is that your later statements are to be
taken as more accurately describing what you really mean.
I believe that your earlier statements, such as
"You should parse the results within an OO framework" are not
to be taken literally, in light of your later elucidations.
> ...you should determine your language
> based on the requirements of your system. So if your problem requires
> paradigm A, you use a language that supports paradigm A. If it
> instead requires paradigm B, you use a language that supports paradigm
> B.
>
> How hard is this principle for you to understand?
Not hard at all.
I am particularly gratified that you encourage the use of a language
which *supports* the chosen paradigm, rather than *enforces* it.
By your statement above, Perl is an acceptable choice (perhaps not
the best) when the paradigm is OO.
> My statements alone are not proof of where I stand?
That's not the issue.
No one wants proof of where you stand.
We want proof for your claims.
If I say "A is true", you want proof that A is true,
not that I believe A is true. In fact, whether or not I actually
believe A is true is irrelevant; I may have been saying it only
for the sake of argument. If you say "OO is the best methodology",
I want proof of the statement, not that you believe it; maybe
you DON'T really believe it; that doesn't matter.
> : : : (Of course, I admit that that is faulty, since in fact Python does
> : : : not enforce OO any more than Perl does. But that's a different
> : : : argument...)
> : :
> : : Would you care to back this up?
By the way, I may have left a loose end in my other response to this.
The point I was trying to make was that Python does not enforce OO
any more than Perl does, and that some sample Python programs
presented in this thread provide supporting evidence.
The mere fact that non-OO Perl code can be transliterated directly
into Python proves that Python does not enforce OO programming.
This, of course, should not be taken as a suggestion that Python
does not *support* OO much better than Perl; I have no doubt
that it does!
--
John "Many Jars" Porter
------------------------------
Date: Wed, 23 Sep 1998 15:47:44 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl and Oraperl
Message-Id: <360915B6.54B03339@bbnplanet.com>
rzmw30 wrote:
> I'm somewhat new to perl and am having problems
> trying to get oraperl to compile and install.
> I've compiled and installed Perl Version 5.005_2
> and it works fine.
Oraperl is outdated (I think, at least I haven't used it in a lonnnnggg
while). Go up to CPAN and get DBI.pm and DBD for Oracle.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Wed, 23 Sep 1998 17:01:58 +0100
From: Knut Barten <apollo@uni-paderborn.de>
Subject: Perl, SWIG, CORBA?
Message-Id: <36091B75.13E6F080@uni-paderborn.de>
Hi folks, (sorry for posting in english to the de. group!)
I need help concerning my problem to connect to CORBA via Perl.
Im working with NT4.0, Visibroker Developer for C++ 3.2, SWIG1.1p5 and
Perl5.004.
What I archived so far is:
- get Perl talk to Corba via perlxs. Works, but seems to be very low
level
development. Especially the type associations must be coded manually.
- get Perl talk to Corba via SWIG. This works fine for very simple
function calls.
But I ran into a problem using the 'cout' command and 'iostream.h'.
I don't get the dll build because the linker fails to bind ostream
objects.
The SWIG doc tells that you can't use operator overloading, so I guess
that
this could be the reason, as I use the '<<' operator with the 'cout'
command?!
Here's the simple example:
--- C(++) file:
#include <iostream.h>
int my_pow(int foo) {
return foo * foo;
}
void my_hello(void) {
cout << "inside my_hello" << endl;
}
void main(void) {
cout << "power=" << my_pow(4) << endl;
my_hello();
}
--- SWIG .i file:
/* hello.i */
%module hello
%{
#include <iostream.h>
%}
extern int my_pow(int);
extern void my_hello(void);
--- Makefile took from the SWIG example and modified:
# Makefile for building an ActiveWare Perl for Win32 extension
# Note : Extensions must be compiled with the C++ compiler!
NAME = hello
SRCS = $(NAME).cpp
IFILE = $(NAME)
INTERFACE = $(IFILE).i
WRAPFILE = $(IFILE)_wrap.cpp
# Location of the Visual C++ tools (32 bit assumed)
TOOLS = c:\Programme\DevStudio\Vc
TARGET = $(NAME).dll
CC = $(TOOLS)\bin\cl.exe
LINK = $(TOOLS)\bin\link.exe
INCLUDE32 = -I$(TOOLS)\include
MACHINE = IX86
# C Library needed to build a DLL
DLLIBC = msvcrt.lib oldnames.lib
# Windows libraries that are apparently needed
WINLIB = kernel32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib
winspool.lib
# Libraries common to all DLLs
LIBS = $(DLLIBC) $(WINLIB)
# Linker options
LOPT = -debug:full -debugtype:cv /NODEFAULTLIB /RELEASE /NOLOGO
/MACHINE:$(MACHINE) -entry:_DllMainCRTStartup@12 -dll
# C compiler flags
CFLAGS = /Z7 /Od /c /W3 /LP /nologo
# Perl 5.004
PERL_INCLUDE = -IT:\perl\v054\lib\CORE
PERLLIB = t:\perl\v054\lib\CORE\perl.lib
PERLFLAGS = /DWIN32 /DMSWIN32 /DWIN32IO_IS_STDIO
perl::
swig -perl5 -c++ -o $(WRAPFILE) $(INTERFACE)
$(CC) $(CFLAGS) $(PERLFLAGS) $(PERL_INCLUDE) $(SRCS) $(WRAPFILE)
set LIB=$(TOOLS)\lib
$(LINK) $(LOPT) -out:$(NAME).dll $(LIBS) $(PERLLIB) $(NAME).obj
$(NAME)_wrap.obj
clean::
rm $(NAME).obj $(NAME)_wrap.* $(NAME).exp $(NAME).pm $(NAME).lib
rm $(NAME).pdb $(NAME).dll
--- and finally the errors I receive:
Microsoft (R) Program Maintenance Utility Version 1.62.7022
Copyright (C) Microsoft Corp 1988-1997. All rights reserved.
swig -perl5 -c++ -o hello_wrap.cpp hello.i
Generating wrappers for Perl 5
c:\Programme\DevStudio\Vc\bin\cl.exe /Z7 /Od /c /W3 /LP /nologo
/DWIN32
/DMSWIN32 /DWIN32IO_IS_STDIO -IT:\perl\v054\lib\CORE hello.cpp
hello_wrap.cpp
Command line warning D4002 : ignoring unknown option '/LP'
hello.cpp
hello_wrap.cpp
Generating Code...
set LIB=c:\Programme\DevStudio\Vc\lib
c:\Programme\DevStudio\Vc\bin\link.exe -debug:full -debugtype:cv
/NODEFA
ULTLIB /RELEASE /NOLOGO /MACHINE:IX86 -entry:_DllMainCRTStartup@12 -dll
-out:hel
lo.dll msvcrt.lib oldnames.lib kernel32.lib advapi32.lib user32.lib
gdi32.lib co
mdlg32.lib winspool.lib t:\perl\v054\lib\CORE\perl.lib hello.obj
hello_wrap.obj
Creating library hello.lib and object hello.exp
hello.obj : error LNK2001: unresolved external symbol "public: class
ostream & _
_thiscall ostream::operator<<(char const *)" (??6ostream@@QAEAAV0@PBD@Z)
hello.obj : error LNK2001: unresolved external symbol "class
ostream_withassign
cout" (?cout@@3Vostream_withassign@@A)
hello.obj : error LNK2001: unresolved external symbol "public: class
ostream & _
_thiscall ostream::operator<<(unsigned char)" (??6ostream@@QAEAAV0@E@Z)
hello.obj : error LNK2001: unresolved external symbol "public: class
ostream & _
_thiscall ostream::flush(void)" (?flush@ostream@@QAEAAV1@XZ)
hello.obj : error LNK2001: unresolved external symbol "public: class
ostream & _
_thiscall ostream::operator<<(int)" (??6ostream@@QAEAAV0@H@Z)
hello.dll : fatal error LNK1120: 5 unresolved externals
NMAKE : fatal error U1077: 'c:\Programme\DevStudio\Vc\bin\link.exe' :
return cod
e '0x460'
Stop.
If you have any ideas or other experience with Perl-2-CORBA
connectivity, SWIG, perlxs then
don't hesitate to reply ...
Thanks much,
Knut Barten
------------------------------
Date: Wed, 23 Sep 1998 15:50:22 GMT
From: Richard Ann <rann@bbn.com>
Subject: question about variable interpolation in search pattern
Message-Id: <360918BD.4F31@bbn.com>
I have a question about variable interpolation and run-time compilation
for search patterns. For the script below:
----------------------------------------
#!/d4mutl/exp.gnu/bin/perl5
$foo = 'there';
$template_line = 'hello $foo';
print "template_line is $template_line\n";
while($line = <>) {
if($line =~ /$template_line/) {
print "Found matching line\n";
print "Line is $line\n";
}
}
exit;
----------------------------------------
I cannot figure out what the end-result search pattern is. I know that a
variable in a search pattern is interpolated, after which the search
pattern is recompiled. This would mean that
$template_line
gets interpolated into
hello $foo
because of the single instead of double quotes that are used.
I would think that here this would get recompiled, which would involve
having to interpolate the variable $foo, which would then give us
hello there
and that this would be the end-result search pattern.
If I pass to this script a file containing lines of text, and a line in
the file contains the string
hello there
then I expect to see the printout "Found matching line" but I don't.
This got me wondering if the variable $foo actually got interpolated, so
on another line in the input file I have the string
hello $foo
but I don't see the "Found matching line" printout either.
Given that I've tried both these test cases, I cannot figure out what
the end-result search pattern is -- what is it?
Thanks in advance,
Richard Ann
------------------------------
Date: Wed, 23 Sep 1998 17:01:27 +0200
From: Casper Kvan Clausen <ckc@dmi.dk>
Subject: Rotating an array.
Message-Id: <Pine.GSO.3.92.980923163020.6326Z-100000@edb>
Hiya all.
I'm mainly asking this to see what sorts of strange and twisted answers
you guys can come up with, since, given the fickle nature of Usenet, I
doubt any answers will appear in time to make into my code.
The problem is this: Given an array A of n elements, how do you most
efficiently construct a new array B containing the same elements, but
rotated so that B[0] = A[n-m], B[1] = A[n-m+1] ... B[m] = A[n]?
I am currently using splice() as follows:
#!/usr/bin/perl -w
@words = qw(one two three four five);
$rot = 2; @a = @words;
@b = splice(@a,$rot,$#a - $rot + 1);
splice (@b,$#b + 1,0,@a);
print "Original order:\n\n";
print join (' ',@words) . "\n\n";
print "New (fnord World fnord) Order:\n\n";
print join (' ',@b) . "\n";
__END__
I know, however, that all y'all's twisted minds can come up with some much
more interesting ways of doing things - some of which might even be more
efficient. Looking forward to seeing them.
Kvan.
-------Casper Kvan Clausen------ | 'Political correctness: Has it had
----------<ckc@dmi.dk>---------- | its day? We interview a leading
Lokal 544 | poof.'
I do not speak for DMI, just me. | - Mel Smith.
------------------------------
Date: Wed, 23 Sep 1998 10:43:15 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Rotating an array.
Message-Id: <36091713.59F7A3BC@gpu.srv.ualberta.ca>
Casper Kvan Clausen wrote:
!
! Hiya all.
!
! I'm mainly asking this to see what sorts of strange and twisted
! answers you guys can come up with, since, given the fickle nature of
! Usenet, I doubt any answers will appear in time to make into my code.
!
! The problem is this: Given an array A of n elements, how do you most
! efficiently construct a new array B containing the same elements, but
! rotated so that B[0] = A[n-m], B[1] = A[n-m+1] ... B[m] = A[n]?
!
! I am currently using splice() as follows:
[snip code]
! I know, however, that all y'all's twisted minds can come up with some
! much more interesting ways of doing things - some of which might even
! be more efficient. Looking forward to seeing them.
one possibility:
@words = qw(one two three four five);
$rot = 2;
@b=@words[$rot--..$#words,0..$rot];
print "@b\n";
regards
andrew
------------------------------
Date: 23 Sep 1998 15:26:53 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: until problem
Message-Id: <6ub3vt$o5a$1@pegasus.csx.cam.ac.uk>
James Ludlow <ludlow@us.ibm.com> wrote:
>Robert F. Soto wrote:
>>
>> Can anyone tell me why this does not work:
>>
>> until (chomp($s = <STDIN>) eq 'q') {print("$s\n");}
>>
>> When $s eq 'q' it still prints.
>
>It doesn't work like you think it does because chomp doesn't return the
>string that it works on. So even if $s eq 'q', chomp($s) will never eq
>'q'.
>
>Check the return value of chomp; you'll see that you've basically been
>using: until (0 eq 'q') { ... }
Actually, perldoc -f chomp shows that you'll usually get
until (1 eq 'q') { ... }
Not that it makes much difference.
Mike Guy
------------------------------
Date: Wed, 23 Sep 1998 15:59:05 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Virtual Memory Question
Message-Id: <3609185E.34FBAB6F@bbnplanet.com>
Craig De Groot wrote:
> The problem is that perl is running out of physical memory and giving me
> an "Out of memory!" error. I need to know if perl uses virtual memory
> by default or if it is running out of swap space as well. If perl does
> not use virtual memory by default how do I turn it on?
Darling, it's a SPARC not a Macintosh. :)
http://www.sunworld.com/sunworldonline/swol-05-1997/swol-05-perf.html
Try that to help explain what memory is and how it is used/reported on
your sparc.
A bad program will consume as much memory as it can get. If your program
is doing this you probably want to look at the code first. Also, you
might also try upping to 5.004 as I vaguely remember a problem with
malloc with some weird stuff we were doing at the time.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3798
**************************************