[6623] in Perl-Users-Digest
Perl-Users Digest, Issue: 248 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 7 15:17:23 1997
Date: Mon, 7 Apr 97 12:00:45 -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 Mon, 7 Apr 1997 Volume: 8 Number: 248
Today's topics:
"AI" in perl? <c-wilson@uchicago.edu>
Accept function call <jason.kruse@teldta.com>
Accepting bid on script <hmpgconn@electro-net.com>
ANNOUNCE: Bit::ShiftReg 2.0 (Steffen Beyer)
Re: CGI Server error (I R A Aggie)
confusion about interface methods and internal class me (Curtis Hrischuk)
Re: confusion about interface methods and internal clas (M.J.T. Guy)
Re: dbm oddity (M.J.T. Guy)
Re: gethostbyname won't use DNS (M.J.T. Guy)
Help with Perl and Frames <lewis@golden-hamster.com>
Re: How can i check that printer exists (M.J.T. Guy)
Re: How can I get the weekday of first day of some mont (M.J.T. Guy)
Newbie question: reference an array with a scalar varia (Andreas Olsson)
Re: Newbie question: reference an array with a scalar v (M.J.T. Guy)
Re: OO-Perl corrupts parameters! (M.J.T. Guy)
Re: Ousterhout and Tcl lost the plot with latest paper <mcc@phouka.watson.ibm.com>
Pattern matching (Regexp) (David Tucker)
Re: Pattern matching (Regexp) (M.J.T. Guy)
perl Alpha compiler on OS/2? (Dan Ascheman)
Re: Perl, Delphi, Linux, Windows, and databases (VB5E?) (Roberto Alsina)
please ignore previous: confusion about interface metho (Curtis Hrischuk)
porting fcntl call: argument types?? <yicky@yack.yucky.yum>
Problem using AdminMisc <jburley@uci.edu>
Re: Problems with OO Perl5 features <tchrist@mox.perl.com>
Renegade script setting own values? <mriggsby@sybex.com>
Re: REQ: help # Need sequential numbers augmented to @v (Bennett Todd)
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Strange warning about split, without a split being (Abigail)
Re: string comparision (M.J.T. Guy)
Re: substituting with /g and simulating "lookbehind" <usenet-tag@qz.little-neck.ny.us>
Re: TCL & interface definitions (was Re: Ousterhout and <spot@cs.cmu.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 7 Apr 1997 17:57:27 GMT
From: Clark Wilson <c-wilson@uchicago.edu>
Subject: "AI" in perl?
Message-Id: <33493587.63E7@uchicago.edu>
Howdy.
Can anyone point me to perl implementations of any basic "AI"-style
stuff? I'm looking for starting points for my own futzing.
I'm interested in inference engines, expert systems or shells, fuzzy
logic, case-based reasoning (esp. case-based planning).
I know about the prolog perl module and have obtained it and run the
little tests that come with it, but it's listed as "alpha" and I don't
know enough to carry it further, and email to the author's address
bounces.
Obviously another approach would be for perl to work cooperatively with
one of the traditional AI languages. If someone has a sample of such a
system I'd be interested to learn more. I know a bit of prolog and am
fitfully learning lisp, but have programmed a good bit in perl. My
target development environment is WinNT. So I have newLISP and Freelisp
and SWI Prolog and the Allegro Common Lisp demo on my system for perl to
talk with.
This is neither for money nor for a course; I'm sort of an AI wannabee
wandering in the wilderness, and I'm interested in building apps for my
own learning and use.
TIA.
Clark Wilson
c-wilson@uchicago.edu
------------------------------
Date: Mon, 07 Apr 1997 10:47:09 -0500
From: jason kruse <jason.kruse@teldta.com>
Subject: Accept function call
Message-Id: <334916FD.65F3@teldta.com>
I'm trying to understand how to it works in perl. Is there a way to do
the following in perl as you can in C?
if (v = select(NUM_FD, &FD_IN, NULL, NULL, NULL) < 0) {
# error
} else {
for (i = 0; i < NUM_FD; i++) {
if (FD_ISSET(i, &FD_IN)){
newsock = accept(mainsocket, blah, blah_length);
}
}
Basically what I want is to be able to get a filehandle from accept.
I've tried using IO::Select, which works fine to listen for the
incomming connnection, and then a series of if statements to find which
of the FD's are set. What happens is that the filenumber for the item
filehandle in the accept always returns the same filenumber.
How do you call accept so that a new file descriptor will be generated
and can be found? Here is what I am doing at present.
#####################
!#/usr/local/bin/perl
use FileHandle;
use IO::Select;
use Socket;
socket(Client, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
socket(Server, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
bind (Client, sockaddr_in(4000, INADDR_ANY));
bind (Server, sockaddr_in(4001, INADDR_ANY));
listen(Client, SOMAXCONN);
listen(Server, SOMAXCONN);
$list = IO::Select->new();
$list->add(\*Client);
$list->add(\*Server);
while (@ready = $list->can_read()) {
foreaech $sock (@ready) {
if ($sock == \*Client) {
accept(Host, Client);
$list->add(\*Host);
}
# Here I want to have a number of people being able to connect to the
# server. How can I do this in a similar fashion as the C function call
# for accept?
elsif ($sock == \*Server) {
accept(Serv, Server);
add_to_list(\*Serv);
}
else {
process($sock);
$list->remove($sock);
close($sock);
}
}
------------------------------
Date: Mon, 07 Apr 1997 02:04:28 -0700
From: George Arnett <hmpgconn@electro-net.com>
Subject: Accepting bid on script
Message-Id: <3348B89C.6D25@electro-net.com>
Please send me your bid for the following script:
I need a cgi script that will allow a random user that visits my Web
site to win stuff. It would require a means for the user to register
with the system (so one user cannot win over and over again), a simple
random selection mechanism, a means for you to "insert" a prize and a
frequency, and a winner confirmation form (with appropriate legaleze
throughout).
If you need more details (or just want to submit your bid), please email
me at mailto:hmpgconn@electro-net.com
------------------------------
Date: 7 Apr 1997 11:31:35 GMT
From: sb@sdm.de (Steffen Beyer)
Subject: ANNOUNCE: Bit::ShiftReg 2.0
Message-Id: <5ialun$jbb$1@nadine.teleport.com>
I am glad to announce
======================================
Module "Bit::ShiftReg" Version 2.0
======================================
to the Perl community.
Contents of this message:
-------------------------
- Legal stuff
- Prerequisites
- What does it do
- Where to find
- Final note
Legal stuff:
------------
Copyright (c) 1997 by Steffen Beyer. All rights reserved.
This package is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
Prerequisites:
--------------
Perl version 5.000 or higher, a C compiler capable of the ANSI C standard (!)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What does it do:
----------------
This module implements rotate left, rotate right, shift left and shift
right operations with carry flag for all C integer types.
The results depend on the number of bits that the integer types unsigned
char, unsigned short, unsigned int and unsigned long have on your machine.
The module automatically determines the number of bits of each integer type
and adjusts its internal constants accordingly.
It also provides subroutines to determine the number of bits of these types
in your Perl programs.
For shift registers of arbitrary size, you can either chain several bytes
together using the functions of this module, or use the new module
"Bit::Vector" (coming soon!).
This latter module is actually the new version of the "Set::IntegerFast"
module, which will be split into a base class, "Bit::Vector", and appli-
cation classes, like "Set::IntegerFast", "Set::IntegerRange" and
"Math::MatrixBool".
Where to find:
--------------
At the usual ftp sites for Perl (CPAN = "Comprehensive Perl Archive Network"):
The file
Bit-ShiftReg-2.0.tar.gz
can be found in directory
.../CPAN/authors/id/STBEY/
or
.../CPAN/modules/by-category/06_Data_Type_Utilities/Bit/
or
.../CPAN/modules/by-module/Bit/
See "The Perl 5 Module List" by Tim Bunce and Andreas Koenig in news:
comp.lang.perl.modules for a list of CPAN ftp servers, or direct your
WWW browser to
http://www.perl.com/CPAN/modules/by-module/Bit-ShiftReg-2.0.tar.gz
and you will be redirected automatically to a CPAN ftp server near you.
You can also download this module from the author's web site at
http://www.engelschall.com/u/sb/download/
where you will also find my other modules and a couple of logos
describing what the modules do.
Final note:
-----------
If you need any assistance or have any comments, problems, suggestions,
findings, complaints, questions, insights, compliments or donations to give ;-)
then please don't hesitate to send me some e-mail:
sb@sdm.de (Steffen Beyer)
Yours sincerely,
--
|s |d &|m | Steffen Beyer <sb@sdm.de> (+49 89) 63812-244 fax -150
| | | | software design & management GmbH & Co. KG
| | | | Thomas-Dehler-Str. 27, 81737 Munich, Germany.
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
------------------------------
Date: Mon, 07 Apr 1997 13:21:59 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: CGI Server error
Message-Id: <fl_aggie-ya02408000R0704971321590001@news.fsu.edu>
In article <3345B6E3.A8F@well.com>, carlmm@well.com wrote:
[posted && cc'd]
+ addee.pl did not produce a valid header (name without
+ value: got line "no write permission to ndbm file at emplib.pl
+ line 71.")
Your program ran into a write permission problem, and bitched about
it. Since it had not sent the appropriate Content-type: header,
the server didn't know what to do about it.
You need to examine 'emplib.pl' at line 71 to understand what file
you're attempting to write to that causes it problems...
James
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 07 Apr 1997 16:25:59 GMT
From: ceh@sundance.sce.carleton.ca (Curtis Hrischuk)
Subject: confusion about interface methods and internal class methods
Message-Id: <CEH.97Apr7122559@sundance.sce.carleton.ca>
Hi. I have run into the situation where the object reference is not
passed on the parameter stack for internal class methods, but it is
passed by external class methods. The package toot is an example
(below).
I can't believe that Perl is implemented this way becuase it requires
the programmer to keep track of which methods are accessed externally
and internally what am I doing wrong?
package toot;
sub external_toot # Accessed only from external object call
{
my $self = shift; # NOTE get object reference
my ($parm) = @_;
internal_toot($parm);
}
sub internal_toot
{
# NOTE Missing shift to get object reference
my($local_var) = @_;
$local_var++;
}
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Curtis Hrischuk (PhD Cand) "in reality that comes from above _/
_/ ceh@sce.carleton.ca God is calling _/
_/ Carleton University there's no bigger love _/
_/ Ottawa, On., Canada, K1S-5B6 It's his reality that welcomes us back_/
_/ Ph (613) 520-2600 x1762 Trust and obey _/
_/ FAX (613) 520-5727 there is no other way..." the newsboys_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
------------------------------
Date: 7 Apr 1997 18:11:04 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: confusion about interface methods and internal class methods
Message-Id: <5ibdbo$qqr@lyra.csx.cam.ac.uk>
Curtis Hrischuk <ceh@sundance.sce.carleton.ca> wrote:
>Hi. I have run into the situation where the object reference is not
>passed on the parameter stack for internal class methods, but it is
>passed by external class methods. The package toot is an example
>(below).
Not sure what you are getting at. The object reference is present for
_any_ method call. It is not present for any subroutine call.
>package toot;
>
>sub external_toot # Accessed only from external object call
>{
> my $self = shift; # NOTE get object reference
> my ($parm) = @_;
>
> internal_toot($parm);
That subroutine call will not have the object as first argument.
$self->internal_toot($parm);
is a method call which does have the object as first argument.
>}
>
>sub internal_toot
>{
> # NOTE Missing shift to get object reference
> my($local_var) = @_;
> $local_var++;
>}
In general, you should decide whether a given sub is to be used as a
method or a subroutine and write the subroutine and its calls accordingly.
There are circumstances where the same subroutine is used in both forms,
but they are rare and usually best avoided. ('can' in package
UNIVERSAL provides a nice example.)
Mike Guy
------------------------------
Date: 7 Apr 1997 18:32:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: dbm oddity
Message-Id: <5ibejc$s69@lyra.csx.cam.ac.uk>
David A. Enete <denete@coe.uga.edu> wrote:
>Hi all. I've just started using dbm files, and have run into a big snag.
>I'm using dbm files to store the listing of a directory for use in another
>script, and can't seem to get the hash that is returned make sense.
You seem to be trying to store references to arrays in the values of the
dbm file. This doesn't work - the values must be strings. For
ways of storing complex structures in dbm files, see the Data::Dumper
and MLDBM modules.
It's a pity that the various dbm modules give no diagnostic in this case.
You probably would have detected it with "use strict;".
Mike Guy
------------------------------
Date: 7 Apr 1997 18:56:50 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: gethostbyname won't use DNS
Message-Id: <5ibg1i$fj@lyra.csx.cam.ac.uk>
Eric M. Kidd <eric.kidd@pobox.com> wrote:
>The Perl function gethostbyname will return hosts in /etc/passwd, but will
>not use the DNS to look up hostnames. C programs such as nslookup, telnet
>and ncftp work just fine, however, so I assume my nameserver is working
>correctly.
>
>Is this a configuration problem of some sort? I'd appreciate any leads.
>From the perlfunc man page:
gethostbyname NAME
...
These routines perform the same functions as their
counterparts in the system library.
So yes - it depends on the configuration of your underlying system, not
on Perl's configuration.
Mike Guy
------------------------------
Date: Mon, 07 Apr 1997 13:31:05 +0000
From: Lewis Kurfist <lewis@golden-hamster.com>
Subject: Help with Perl and Frames
Message-Id: <3348F707.3002@golden-hamster.com>
Can perl be used to dynamically create a frames page and are there any
special considerations to keep in mind when creating the perl script and
the html files it calls.
Lewis
------------------------------
Date: 7 Apr 1997 18:24:19 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How can i check that printer exists
Message-Id: <5ibe4j$rm9@lyra.csx.cam.ac.uk>
peglow <peglow@berlin.snafu.de> wrote:
>How can I check wether a printer exists or not. I am using perl5 under
>Solaris 2.5.1.
>If I do a
> open(LPR,"|lpr -h -P nonexistentprinter") || &PrinterFault;
>
>or
>
> unless (LPR,"|lpr -h -P nonexistentprinter") {
> &PrinterFault;
> } else {
> # print all the stuff
> }
>
>this will not work. I get a (unix-)-error-message, but perl does not branch
>into the
>PrinterFault subroutine.
open only gets an error in the unusual case when the fork to create the
shell fails. Errors from the command actually obeyed are only
detected in $? on the _close_ of the pipe. See then entries for "open"
and "close" in perlfunc.
Mike Guy
------------------------------
Date: 7 Apr 1997 18:25:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How can I get the weekday of first day of some month in perl ?
Message-Id: <5ibe76$ro7@lyra.csx.cam.ac.uk>
Fu-Chin <fliu@ccl.itri.org.tw> wrote:
>As subject above.
By looking in dejanews for the answer to this question which was given
last week.
Mike Guy
------------------------------
Date: Mon, 07 Apr 97 18:16:57 GMT
From: cie95aol@lustudat.student.lu.se (Andreas Olsson)
Subject: Newbie question: reference an array with a scalar variable?
Message-Id: <5ibdnn$78c$1@news.lth.se>
This should be simple, but I don't get it to work properly.
for($i = 0; $i < $nbrofitems; $i++) {
print $table[$i];
}
Coming from pascal, I can't see why this is'nt working.
Help me someone, please!
Thanks in advance
/Andreas Olsson
cie95aol@lustudat.student.lu.se
------------------------------
Date: 7 Apr 1997 18:35:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Newbie question: reference an array with a scalar variable?
Message-Id: <5ibepb$sgk@lyra.csx.cam.ac.uk>
Andreas Olsson <cie95aol@lustudat.student.lu.se> wrote:
>This should be simple, but I don't get it to work properly.
>
>for($i = 0; $i < $nbrofitems; $i++) {
> print $table[$i];
>}
>
>Coming from pascal, I can't see why this is'nt working.
Nor can we see why this isn't working, without knowing
a) what you expected
b) how what you got differed from that.
Apart from that, if you aren't already using -w, do so. It often debugs
your scripts for you.
Mike Guy
------------------------------
Date: 7 Apr 1997 17:38:38 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: OO-Perl corrupts parameters!
Message-Id: <5ibbeu$o70@lyra.csx.cam.ac.uk>
Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu> wrote:
>Carl <ceklof@vt.edu> writes:
>> AND THEN, MY HASHES ARE REVERSED, KEY->VALUE, VALUE->KEY!!! Needless to
>> say, this is bad!
>
>This is also unclear, since you don't give an example.
Presumably he tried to convert something like
sub mysub {
my %args = @_;
...
};
mysub( a => 1, b => 2, c => 3);
into
sub mymethod {
my %args = @_;
...
};
$obj->mymethod( a => 1, b => 2, c => 3);
which would "reverse his hashes".
So, the normal paradigm is
sub mymethod {
my $self = shift; # move that extra arg out of thye way
my %args = @_;
...
};
Read perltoot for more information.
Mike Guy
------------------------------
Date: 07 Apr 1997 14:27:56 -0400
From: Mark Chu-Carroll <mcc@phouka.watson.ibm.com>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <v87sp126637.fsf@phouka.watson.ibm.com>
fellowsd@cs.man.ac.uk (Donal K. Fellows) writes:
> In article <E88Ir4.EK4@undergrad.math.uwaterloo.ca>,
> Paul Prescod <papresco@csclub.uwaterloo.ca> wrote:
> [ JO's simple button example elided ]
> > Easier to use for people who are not knowledgable about the language? Yes.
> > Easier to use for people who are? No. The latter is certainly no harder
> > for a MCL programmer than the former is for a TCL programmer. It will also
> > be easier to maintain, for all of the usual reasons.
>
> OK, let's raise the stakes a little. :^)
>
> toplevel .t
> button .t.b -text Hi! -font {Times 16} -command {puts "Pressed at (%x,%y)"}
> pack .t.b -fill both -expand 1
>
> The button now appears in a separate window to the main application
> window, and reports where it was pressed. When this window is
> resized, the button will occupy any extra space allocated. How much
> extra Lisp would be needed to achieve this?
>
> Unless you can do this in very few lines, the point about Tcl being
> better for some things would seem to be made amply to me.
It's been a while since I've used STK, so I'll use a pseudo-syntax. This
is very close to how it would appear in STk using STklos:
(define top (make <Toplevel> :fill 'both :expand t))
(define but (make <button>
:font "Times 16"
:in top :fill 'both :expand t
:command (lambda (x y)
(display "Pressed at (" x "," y ")"))))
(pack but top)
There you go. Big deal.
At this level, we're discussing trivialities. Sure, TK is cool. But
*lots* of languages can be used to define TK bindings, and many of
them are as simple and succinct at TCL. We can play games with
comparing the number of lines of TCL/TK compared to other TK bindings
all day, and we won't learn anything interesting.
The question is, is Ousterhout's claim that TCL is a good glue
language for significant applications correct? These little 5 line
pissing contests do nothing to address that claim.
Personally, I believe, from my own experience, that TCL is *not* a
good glue language. I've been working, on and off, on a text
editor. The earliest was written in TCL. For that, TCL was really a
nightmare - the lack of real data structures was extremely painful;
the lack of encapsulation was extremely painful. It's my belief that
lacking any support for these two was a crucial mistake in the design
of TCL. The lack of support for data structures is particularly
damning when you realize how trivial it would have been to add some
kind of structure support like Lisps cons-cells.
<MC>
--
Mark Craig Chu-Carroll || "I'm not dumb,
IBM T.J. Watson Research Center || I just have a command of thoroughly useless
mcc@watson.ibm.com || information." --- Calvin
------------------------------
Date: 7 Apr 1997 15:55:59 GMT
From: david@temss2.main.temple.edu (David Tucker)
Subject: Pattern matching (Regexp)
Message-Id: <5ib5ef$44m@cronkite.ocis.temple.edu>
I am a definite Perl newbie so let me first preface
this question by apologizing for what may seem to be
a simplistic question.
I am trying to weed out bad dates in a perl subroutine.
So I am using the following code
# A date in the form MM/DD/YY where @_ holds the date
if ( ! /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]/ ) { die "blah...";}
It does not work at all.
Could someone tell me what I am doing wrong?
Thank you in advance.
David
------------------------------
Date: 7 Apr 1997 18:03:08 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Pattern matching (Regexp)
Message-Id: <5ibcss$q76@lyra.csx.cam.ac.uk>
David Tucker <david@temss2.main.temple.edu> wrote:
>I am trying to weed out bad dates in a perl subroutine.
>So I am using the following code
>
> # A date in the form MM/DD/YY where @_ holds the date
I hope you mean $_, not @_. Otherwise it won't work.
> if ( ! /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]/ ) { die "blah...";}
>
>It does not work at all.
>
>Could someone tell me what I am doing wrong?
i) Not using -w? That would tell you if indeed you are using $_
without setting it.
ii) That regex will also match things you don't want, such as 123/45/678.
You probably want to anchor it, i.e.
/^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]$/
iii) Warning: two digit dates used in pre-millennial context.
Apart from that, without knowing what you mean by 'does not work', I can't
suggest anything.
Mike Guy
------------------------------
Date: 7 Apr 1997 18:21:49 GMT
From: asched1@medtronic.COM (Dan Ascheman)
Subject: perl Alpha compiler on OS/2?
Message-Id: <5ibdvt$8f9$1@gazette.corp.medtronic.com>
Hi all,
I was wondering is anyone has used the Alpha compiler in Conjunction with
perl 5.3 on Os/2 ? It works on Unix fine, and I am about 1 step away from
converting a perl script to a C program, and executable. My problem is
that gmake does NOT successfully compile my makefile, thus I do not get my
loadable objects, which i need to convert a perl script to a c program.
Any help at all is appreciated,
thanks,
Dan
--
Dan Ascheman
@medtronic.com
instruments phone: x4880 Mail Stop: T426
------------------------------
Date: 7 Apr 1997 17:49:59 GMT
From: ralsina@ultra7.unl.edu.ar (Roberto Alsina)
Subject: Re: Perl, Delphi, Linux, Windows, and databases (VB5E?)
Message-Id: <slrn5kicss.1cq.ralsina@ultra7.unl.edu.ar>
In article <01bc42e9$9c1709e0$2a99c5c1@charly>, Karlheinz Spdth wrote:
>
>> Chris Schoenfeld wrote:
>>
>>
>> Delphi wants to use Oracle, Sybase, Informix, or Interbase.
>> From what I understand, Perl has modules for some/all of these in
>> various stages of robustness.
>> NONE of these databases support Linux - GRRRR!!!
>>
>
>It is possible to use the ODBC driver of mysql to access a Linux server.
And at least Informix SE for SCO works *very* well under Linux. It works
quite faster than under SCO (my personal opinion, no benchmarks)
>
>
>--
>-------------------------- EMAIL ONLY ------------------------
>Karlheinz Spaeth
>Werkstr. 5
>73312 Geislingen, Germany
>-------------------------------------------------------------------
--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) ralsina@unl.edu.ar
(_Y_.)' ._ ) `._`. " -.-' Centro de Telematica
_..`-'_..-_/ /-'_.' Universidad Nacional del Litoral
(l)-'' ((i).' ((!.' Santa Fe - Argentina
------------------------------
Date: 07 Apr 1997 16:27:59 GMT
From: ceh@sundance.sce.carleton.ca (Curtis Hrischuk)
Subject: please ignore previous: confusion about interface methods and internal class methods
Message-Id: <CEH.97Apr7122759@sundance.sce.carleton.ca>
Hi. I answered my own question in the meantime. One must
consistiently use $self:
$self->internal_too($parm)
Sorry, my fingers were faster than my synapses.
Curtis
>> Hi. I have run into the situation where the object reference is not
>> passed on the parameter stack for internal class methods, but it is
>> passed by external class methods. The package toot is an example
>> (below).
>>
>> I can't believe that Perl is implemented this way becuase it requires
>> the programmer to keep track of which methods are accessed externally
>> and internally what am I doing wrong?
>>
>> package toot;
>>
>> sub external_toot # Accessed only from external object call
>> {
>> my $self = shift; # NOTE get object reference
>> my ($parm) = @_;
>>
>> internal_toot($parm);
>> }
>>
>> sub internal_toot
>> {
>> # NOTE Missing shift to get object reference
>> my($local_var) = @_;
>> $local_var++;
>> }
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Curtis Hrischuk (PhD Cand) "in reality that comes from above _/
_/ ceh@sce.carleton.ca God is calling _/
_/ Carleton University there's no bigger love _/
_/ Ottawa, On., Canada, K1S-5B6 It's his reality that welcomes us back_/
_/ Ph (613) 520-2600 x1762 Trust and obey _/
_/ FAX (613) 520-5727 there is no other way..." the newsboys_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
------------------------------
Date: Mon, 07 Apr 1997 10:13:57 -0700
From: yicky <yicky@yack.yucky.yum>
Subject: porting fcntl call: argument types??
Message-Id: <33492B55.5311@odin.sunquest.com>
Having got a
use Fcntl;
fcntl( FH, O_NONBLOCK, $packedreturnbuffer)|| die "horribly";
to work on one unix box, I tried porting it to another. But the second
required something along the lines of
fcntl( FH, F_SETFL, ???);
where the ??? was an unknown argument type. I've tried packing the
O_NONBLOCK several different ways, passing the value through variables,
etc. I've also tried setting other flags than O_NONBLOCK.
I've looked through the perl docs, fcntl manpages, fcntl .h, blah, blah,
blah, but the answer is escaping me.
According to all this documentation, the fcntl is supposed to be
fcntl( (int) file, (int) operation, (int) param)
under c, which *should* translate to
fcntl( filehandle, int, int)
under perl, but apparantly doesn't. <arrggh!>
Anyone have some ideas about what the third (and possibly second)
argument should be?
Thanks.
(I would appreciate email, but posting here is fine.)
------------------------------
Date: Mon, 07 Apr 1997 10:46:09 -0700
From: Josh Burley <jburley@uci.edu>
Subject: Problem using AdminMisc
Message-Id: <334932E1.14EE@uci.edu>
Hi all,
After finally getting adminmisc to work for me (thanks roth!) i'm
having trouble with the UserCheckPassword and/or LogonAsUser to check a
user's password on the domain. I did read the info about how
UserCheckPassword works, and everything on the Domain is set seemingly
perfect for using UserCheckPassword.
All I'm doing is passing in the username and password from a form
directly into the UserCheckPassword function. And the Domain is simply
the UNC for the Domain Controller. (and yes, I did put 4 \'s instead of
just 2).
Any help anyone?
Joshua Burley
UNIX/NT/WWW Admin
Grad. School of Mgmt.
University of Cal., Irvine
------------------------------
Date: 7 Apr 1997 18:15:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Problems with OO Perl5 features
Message-Id: <5ibdk0$dk$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Luca Passani <lpa@sysdeco.no> writes:
:### perl -d convertdia.pl diag0
:Stack dump during die enabled outside of evals.
:
:Loading DB routines from perl5db.pl patch level 0.94
:Emacs support available.
:
:Enter h or `h h' for help.
:
:Undefined subroutine &Carp::longmess called at
:/usr/local/lib/perl5/perl5db.pl l
:ine 1361.
:###
That happens when you have a syntax error in your original program.
If you can't compile, you can't debug.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
/* And you'll never guess what the dog had */
/* in its mouth... */
--Larry Wall in stab.c from the v4.0 perl source code
------------------------------
Date: Mon, 07 Apr 1997 10:48:58 -0700
From: Matt Riggsby <mriggsby@sybex.com>
Subject: Renegade script setting own values?
Message-Id: <3349338A.431F@sybex.com>
I'm trying to use perl to restructure some old mail archives. The
intent is to cruise through the messages, extract the Date:, From:, and
Subject: lines, trip a flag when it hits the line that invariably comes
before the first line of the body text, read all subsequent lines into
one long string, turn the flag off when it hits the end of the message,
and write the whole mess to a file when it hits a new message. The
result should be a file with the simplified (that is, minus the To:
line, various X- messages, and other header material) messages on single
"lines" separated by a newline. My problem is that the variable I'm
using to mark the beginning and end of the body text appears to be on at
all times. As a result, the Date:, From:, and Subject: lines are all
fine, but the body text variable includes *everything* else. Clearly,
I'm missing something important and obvious, but I haven't a clue what
it could be. Here's my script:
# Open filehandles for input and output. Yes, I'm on NT.
open(INPUT, "C:\\sample.txt") || die "Couldn't open input file.";
open(OUTPUT, "> C:\\filtered.txt") || die "Couldn't create output
file.";
# $bodyappend is the flag that should tell the script whether or not
# to append a line to the body text.
$bodyappend = "No";
while (<INPUT>) {
# on a new mesage, dump output to filtered.txt and reset all the
# variables to null values. Make sure $bodyappend is No.
if (/Return-Path: /) {
$_ = "";
print OUTPUT $valueholder{date};
print OUTPUT $valueholder{from};
print OUTPUT $valueholder{subject};
print OUTPUT $valueholder{body};
print OUTPUT "\n";
$valueholder{date} = "";
$valueholder{from} = "";
$valueholder{subject} = "";
$valueholder{body} = "";
$bodyappend = "No";
}
# assign the value of "From"
if (/From: /) {
chop;
$value = $_;
$valueholder{from}=$value;
}
# I've omitted the Date and Subject bits, which use the exact same
# code with names changed to protect the innocent.
# This is where things go wrong.
# At the end of the message, turn $bodyappend to "No" and slap a
# newline character at the end of the body text.
if (/-- End --/){
$bodyappend = "No";
$valueholder{body} .= "\n";
}
# If $bodyappend is "Yes," attach the current line to the end of
# the body text
if ($bodyappend = "Yes") {
chop;
$value = $_;
$valueholder{body} .= $value;
}
# If the current line includes "X-PMFLAGS:" attach a marker (Bodytext)
# to the variable and set $bodyappend to "Yes".
if (/X-PMFLAGS: /){
$valueholder{body} .= "Bodytext";
$bodyappend = "Yes";
}
}
# Out of lines. Close the files, and we're done.
close(INPUT);
close(OUTPUT);
------------------------------
Date: 7 Apr 1997 16:09:30 GMT
From: bet@rahul.net (Bennett Todd)
Subject: Re: REQ: help # Need sequential numbers augmented to @variable_name
Message-Id: <slrn5ki71q.kos.bet@waltz.rahul.net>
On Sat, 05 Apr 1997 18:16:41 GMT, RGA@IO.COM <rga@io.com> wrote:
> # @new_line1 = split(/#/,$lines[0]);
> # @new_line2 = split(/#/,$lines[1]);
> # @new_line3 = split(/#/,$lines[2]);
Why not use a two-dimensional array [ excuseme, I meant an array of references
to arrays, sorry, no offence intended:-) ] e.g.:
my(@new_line) = ();
for (@lines) {
push @new_line, [ split /#/, $_ ];
}
Then access them as $new_line[$row][$col];
-Bennett
------------------------------
Date: 7 Apr 1997 16:00:19 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5ib5mj$4u8$1@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 29 Mar 1997 11:14:57 GMT and ending at
05 Apr 1997 05:49:23 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^(>|:|\S+>)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" e-mail address and name.
Excluded Posters
================
perlfaq-suggestions@mox.perl.com
Totals
======
Total number of posters: 459
Total number of articles: 889
Total number of threads: 363
Total volume generated: 1655.3 kb
- headers: 618.7 kb
- bodies: 988.9 kb (697.5 kb original)
- signatures: 46.0 kb
Averages
========
Number of posts per poster: 1.9
Number of posts per thread: 2.4
Message size: 1906.6 bytes
- header: 712.6 bytes
- body: 1139.1 bytes (803.4 bytes original)
- signatures: 53.0 bytes
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
39 64.8 ( 27.3/ 37.4/ 19.8) Simon Hyde (aka Jeckyll) <shyde@poboxes.com>
37 75.4 ( 22.0/ 53.3/ 32.3) Tad McClellan <tadmc@flash.net>
37 53.0 ( 30.2/ 22.7/ 15.8) Tom Phoenix <rootbeer@teleport.com>
37 47.0 ( 22.2/ 24.8/ 18.6) Nathan V. Patwardhan <nvp@shore.net>
20 101.3 ( 15.2/ 82.8/ 77.0) Tom Christiansen <tchrist@mox.perl.com>
17 25.5 ( 10.6/ 14.9/ 9.6) Eric Bohlman <ebohlman@netcom.com>
16 39.7 ( 14.4/ 25.3/ 15.1) Douglas Seay <seay@absyss.fr>
15 22.1 ( 8.1/ 14.0/ 5.9) David Alan Black <dblack@icarus.shu.edu>
12 16.3 ( 7.2/ 9.1/ 3.9) Geoffrey Hebert <soccer@microserve.net>
11 22.6 ( 8.8/ 9.7/ 6.1) Randal Schwartz <merlyn@stonehenge.com>
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
101.3 ( 15.2/ 82.8/ 77.0) 20 Tom Christiansen <tchrist@mox.perl.com>
75.4 ( 22.0/ 53.3/ 32.3) 37 Tad McClellan <tadmc@flash.net>
64.8 ( 27.3/ 37.4/ 19.8) 39 Simon Hyde (aka Jeckyll) <shyde@poboxes.com>
53.0 ( 30.2/ 22.7/ 15.8) 37 Tom Phoenix <rootbeer@teleport.com>
48.9 ( 2.3/ 46.6/ 12.0) 2 Chris Bitmead <Chris.Bitmead@alcatel.com.au>
47.0 ( 22.2/ 24.8/ 18.6) 37 Nathan V. Patwardhan <nvp@shore.net>
39.7 ( 14.4/ 25.3/ 15.1) 16 Douglas Seay <seay@absyss.fr>
33.9 ( 2.7/ 31.3/ 24.1) 6 David Combs <dkcombs@netcom.com>
25.5 ( 10.6/ 14.9/ 9.6) 17 Eric Bohlman <ebohlman@netcom.com>
22.6 ( 8.8/ 9.7/ 6.1) 11 Randal Schwartz <merlyn@stonehenge.com>
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
26 Unix and ease of use (WAS: Who makes more ...)
14 Ousterhout and Tcl lost the plot with latest paper
13 New Microsoft Perl Product (fwd)
9 Functions and operators
9 Simple array question by newbie...
9 running a loop foreach $ARGV?
8 Perl mishandles some multidimensional array references???
7 Who makes more $$ - Windows vs. Unix programmers?
7 substituting with /g and simulating "lookbehind"
7 Has anyone heard the rumour that Microsoft have bought Perl?
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
95.8 ( 15.2/ 80.2/ 29.5) 14 Ousterhout and Tcl lost the plot with latest paper
73.8 ( 34.5/ 37.1/ 18.2) 26 Unix and ease of use (WAS: Who makes more ...)
68.4 ( 1.3/ 66.8/ 66.6) 2 Why doesn't pod2html send its default output to STDOUT?
24.1 ( 1.6/ 22.4/ 18.2) 3 HELP: trouble "making" perl5.003_94
19.0 ( 8.7/ 9.7/ 4.9) 13 New Microsoft Perl Product (fwd)
17.8 ( 4.3/ 13.3/ 10.9) 7 Perl vs. C/C++
17.5 ( 5.8/ 11.0/ 7.4) 4 Unix and ease of use (WAS: Who makes more ...)
17.4 ( 8.3/ 8.4/ 4.6) 9 Functions and operators
16.8 ( 5.9/ 9.5/ 6.7) 8 Perl mishandles some multidimensional array references???
16.7 ( 11.6/ 4.9/ 3.0) 7 Who makes more $$ - Windows vs. Unix programmers?
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
56 comp.lang.tcl
54 comp.lang.c++
41 comp.databases
39 comp.lang.javascript
39 comp.lang.c
38 comp.unix.advocacy
38 comp.os.ms-windows.advocacy
38 comp.os.linux.advocacy
38 comp.object
38 comp.lang.basic.visual
Top 10 Crossposters
===================
Articles Address
-------- -------
52 Michael Craft <jsi@idiom.com>
52 Douglas Seay <seay@absyss.fr>
31 mvw@ozemail.com.au
31 jason olmsted <olmstj@phat-media.com>
26 tw104@york.ac.uk
25 Eric Bohlman <ebohlman@netcom.com>
23 Erik Ernst <eernst@fraxinus.daimi.aau.dk>
23 "Daniel Kang" <dan.kang@nuri.net>
20 "John W. Lemons III" <jlemons@myriad.net>
20 the one and only real true kibo <kibo@dhp.com>
------------------------------
Date: Mon, 7 Apr 1997 16:31:02 GMT
From: abigail@ny.fnx.com (Abigail)
Subject: Re: Strange warning about split, without a split being used.
Message-Id: <E8A0Jq.Cx1@nonexistent.com>
On Mon, 07 Apr 1997 09:47:57 -0400, Aaron Sherman wrote in comp.lang.perl.misc:
++ Abigail wrote:
++ >
++ > Earlier today, I did:
++ >
++ > #!/usr/local/bin/perl -wT
++ > $ENV {PATH} = qw (/usr/bin /bin);
++ >
++ > (Of course I wanted to do: $ENV {PATH} = join ":", qw (/usr/bin /bin);)
++ >
++ > The warning I got when running this was:
++ >
++ > Use of implicit split to @_ is deprecated at - line 1.
++ >
++ > That surprised me, as there is no split being used.
++ >
++ > Is this a bug, or does qw call split when being used in a scalar context?
++
++ qw is split, but I don't know why this message appeared. Could
++ it be that space between qw and ( ? Remember this is not a
++ function, but a delimeted operator.
No, it's not the sapce, I use that all the time.
As others pointed out, qw does a split on white space, so I assume
the same internal functions are being used which are also being
used by split(). And since this is evaluated in a scalar context,
it will split into @_, and then return the length of the array.
Now, split()ting silently into @_ triggers the warning, and since
qw uses the same internal functions, it gets the same warning -
which mentions split. :\
Abigail
------------------------------
Date: 7 Apr 1997 18:19:41 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: string comparision
Message-Id: <5ibdrt$rh0@lyra.csx.cam.ac.uk>
Vladimir Alexiev <vladimir@cs.ualberta.ca> wrote:
>In article <5i427m$jia$1@mathserv.mps.ohio-state.edu> ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
>
>> > $ perl -e 'print "\x80" cmp "\x7F", "\n";'
>> > -1
>> Upgrade. This particular bug in (Solaris?) CRT was discovered only
>> recently, so perls starting from 5.003_16 (or around) check for it
>> before the build.
>
> Platform:
> osname=sunos, osver=4.1.4, archname=sun4-sunos
> uname='sunos sunkay 4.1.4 5 sun4m '
This bug was actually found under SunOS 4.1.3, so you need to upgrade
to the 5.004beta.
Mike Guy
------------------------------
Date: 7 Apr 1997 16:58:57 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: substituting with /g and simulating "lookbehind"
Message-Id: <5ib94h$la4$1@news.netusa.net>
Posted and mailed to Michael.
David Combs <dkcombs@netcom.com> wrote:
>Michael Krell <mk2h@clove.cs.Virginia.EDU> wrote:
>>I'm trying to write a regex that will strip out all occurances of the "{"
>>character from a string, unless the brace is immediately preceded by a
>>backslash.
>Why not do it in two passes?
Oh, that's no fun.
>Just change all \{ to foobletch or something unique,
Well doing it with a character by character processing would be
better unless you can have 100% confidence that your "unique"
string will not be in the input. Still, I want to do it as a s///
to show I can:
s/^{//;
s/(\\{)|{/$1/g;
Combine into one big RE if you like, but two steps is probably
more efficient.
Test input:
This is a { test of \{ stripping.
{ that seems \{{ to work \\{ well \\ enough
\{ I'd say.
Test output:
This is a test of \{ stripping.
that seems \{ to work \\{ well \\ enough
\{ I'd say.
Elijah
------
allowing backslash to escape backslashes, now that would be a challenge
------------------------------
Date: Mon, 07 Apr 1997 13:39:16 -0400
From: Scott Draves <spot@cs.cmu.edu>
To: Mark Sterin <msterin@bmc.com>
Subject: Re: TCL & interface definitions (was Re: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <33493144.392C859E@cs.cmu.edu>
<jack@cwi.nl> said
> the one thing that gives continuous headaches is the lack of interface
> definitions. Whenever you change an interface it is very very
> difficult to check that you haven't inadvertantly broken something.
<msterin@bmc.com> said
> This what the regression testing is for, isn't it ?
sure, but it's a lot faster and much less work
to have the compiler type-check your program.
you can do regression testing too if you have time
and really need to.
ob ouster bashing:
is a button a component?
what's the difference between a component and a function?
--
balance
equilibrium
death
http://www.cs.cmu.edu/~spot
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 248
*************************************